first commit
This commit is contained in:
675
wp-content/plugins/all-in-one-wp-migration/LICENSE
Normal file
675
wp-content/plugins/all-in-one-wp-migration/LICENSE
Normal file
@@ -0,0 +1,675 @@
|
||||
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:
|
||||
|
||||
<program> Copyright (C) <year> <name of author>
|
||||
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>.
|
||||
@@ -0,0 +1,78 @@
|
||||
<?php
|
||||
/**
|
||||
* Plugin Name: All-in-One WP Migration
|
||||
* Plugin URI: https://servmask.com/
|
||||
* Description: Migration tool for all your blog data. Import or Export your blog content with a single click.
|
||||
* Author: ServMask
|
||||
* Author URI: https://servmask.com/
|
||||
* Version: 7.52
|
||||
* Text Domain: all-in-one-wp-migration
|
||||
* Domain Path: /languages
|
||||
* Network: True
|
||||
*
|
||||
* Copyright (C) 2014-2020 ServMask Inc.
|
||||
*
|
||||
* 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/>.
|
||||
*
|
||||
* ███████╗███████╗██████╗ ██╗ ██╗███╗ ███╗ █████╗ ███████╗██╗ ██╗
|
||||
* ██╔════╝██╔════╝██╔══██╗██║ ██║████╗ ████║██╔══██╗██╔════╝██║ ██╔╝
|
||||
* ███████╗█████╗ ██████╔╝██║ ██║██╔████╔██║███████║███████╗█████╔╝
|
||||
* ╚════██║██╔══╝ ██╔══██╗╚██╗ ██╔╝██║╚██╔╝██║██╔══██║╚════██║██╔═██╗
|
||||
* ███████║███████╗██║ ██║ ╚████╔╝ ██║ ╚═╝ ██║██║ ██║███████║██║ ██╗
|
||||
* ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
die( 'Kangaroos cannot jump here' );
|
||||
}
|
||||
|
||||
// Check SSL Mode
|
||||
if ( isset( $_SERVER['HTTP_X_FORWARDED_PROTO'] ) && ( $_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https' ) ) {
|
||||
$_SERVER['HTTPS'] = 'on';
|
||||
}
|
||||
|
||||
// Plugin Basename
|
||||
define( 'AI1WM_PLUGIN_BASENAME', basename( dirname( __FILE__ ) ) . '/' . basename( __FILE__ ) );
|
||||
|
||||
// Plugin Path
|
||||
define( 'AI1WM_PATH', dirname( __FILE__ ) );
|
||||
|
||||
// Plugin URL
|
||||
define( 'AI1WM_URL', plugins_url( '', AI1WM_PLUGIN_BASENAME ) );
|
||||
|
||||
// Plugin Storage URL
|
||||
define( 'AI1WM_STORAGE_URL', plugins_url( 'storage', AI1WM_PLUGIN_BASENAME ) );
|
||||
|
||||
// Plugin Backups URL
|
||||
define( 'AI1WM_BACKUPS_URL', content_url( 'ai1wm-backups', AI1WM_PLUGIN_BASENAME ) );
|
||||
|
||||
// Include constants
|
||||
require_once dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'constants.php';
|
||||
|
||||
// Include deprecated
|
||||
require_once dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'deprecated.php';
|
||||
|
||||
// Include functions
|
||||
require_once dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'functions.php';
|
||||
|
||||
// Include exceptions
|
||||
require_once dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'exceptions.php';
|
||||
|
||||
// Include loader
|
||||
require_once dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'loader.php';
|
||||
|
||||
// =========================================================================
|
||||
// = All app initialization is done in Ai1wm_Main_Controller __constructor =
|
||||
// =========================================================================
|
||||
$main_controller = new Ai1wm_Main_Controller();
|
||||
320
wp-content/plugins/all-in-one-wp-migration/changelog.txt
Normal file
320
wp-content/plugins/all-in-one-wp-migration/changelog.txt
Normal file
@@ -0,0 +1,320 @@
|
||||
= 5.56 =
|
||||
* Fix an issue with WP_Hook class introcuded in WP 4.7
|
||||
|
||||
= 5.55 =
|
||||
* Fix an issue with resolving URL on export/import when using non-blocking streams client
|
||||
|
||||
= 5.54 =
|
||||
* Fix an issue with resolving URL on export/import
|
||||
|
||||
= 5.53 =
|
||||
* Send HTTP basic authorization header on upload (fetch method)
|
||||
* Add Accept-Encoding, Accept-Charset and Accept-Language on export/import
|
||||
* Do not replace already replaced values on database import/export
|
||||
* Set silent mode when activating sidewide plugins
|
||||
* Replace old media style URLs with the new media style URLs on database import
|
||||
* Replace user_level and capabilities user meta keys if tables have empty prefix on export
|
||||
* Create separate action for extracting must-use plugins
|
||||
* Add option "Do not export must-use plugins" in advanced settings
|
||||
* Fix an issue with SSL that produces "Unable to resolve URL..."
|
||||
|
||||
= 5.52 =
|
||||
* Simplify the text on import page
|
||||
* Fix an issue with special characters on export and import
|
||||
* Fix an issue with export and import of large files
|
||||
|
||||
= 5.51 =
|
||||
* Add support for utf8mb4_unicode_520_ci database collation
|
||||
|
||||
= 5.50 =
|
||||
* Improve database export process
|
||||
* Simplify export and import cron
|
||||
* Fix an issue with export and import progress status
|
||||
|
||||
= 5.49 =
|
||||
* Test plugin up to WordPress 4.6
|
||||
|
||||
= 5.48 =
|
||||
* Improve support for large databases on export
|
||||
* Add support for Box cloud storage
|
||||
* Fix an issue with status on export/import
|
||||
* Fix an issue with asynchronous requests on export/import
|
||||
|
||||
= 5.47 =
|
||||
* Fix an issue with incorrect file size on export
|
||||
|
||||
= 5.46 =
|
||||
* Add "Restore from Backups" video in readme file
|
||||
* Display message if backups are inaccessible
|
||||
|
||||
= 5.45 =
|
||||
* Fix an issue with blogs.dir path replacement
|
||||
|
||||
= 5.44 =
|
||||
* Add "Do not replace email domain" option in advanced settings
|
||||
* Add "ai1wm_exclude_content_from_export" WordPress hook on export
|
||||
* Add HTML5 uploader
|
||||
|
||||
= 5.43 =
|
||||
* Fix an issue when archiving dynamic files on export
|
||||
* Support custom upload path for multisites
|
||||
* Add support for various cache plugins
|
||||
|
||||
= 5.42 =
|
||||
* Catch E_PARSE error on mu-plugins import
|
||||
* Fix an issue with stop export that doesn't clean up the storage directory
|
||||
* Initialize new cache instead of flushing the existing one on import/export
|
||||
|
||||
= 5.41 =
|
||||
* Fix an issue when replacing serialized values on import
|
||||
* List files in chunks
|
||||
* Convert svg images to png
|
||||
* Check if backups are readable before displaying them on "Backups" page
|
||||
* Display version incompatibility notification on export/import/restore screen
|
||||
* Fix double port issue on Bitnami
|
||||
* Fix an issue on multisite export with cloud extensions
|
||||
|
||||
= 5.40 =
|
||||
* Test plugin up to WordPress 4.5
|
||||
|
||||
= 5.39 =
|
||||
* Fix a bug in uploads path replacement
|
||||
|
||||
= 5.38 =
|
||||
* Deactivate mu-plugins if fatal error appears on import
|
||||
|
||||
= 5.37 =
|
||||
* Validate the archive before import
|
||||
|
||||
= 5.36 =
|
||||
* Add OneDrive to readme.txt
|
||||
* Fix a typo on import
|
||||
|
||||
= 5.35 =
|
||||
* Add OneDrive to export/import pages
|
||||
* Fix a bug when WordPress was used without a db prefix
|
||||
* Fix a problem when downloading wpress files
|
||||
* Improve the log system
|
||||
|
||||
= 4.19 =
|
||||
* Fixed an issue with options cache
|
||||
|
||||
= 4.18 =
|
||||
* Fixed an issue with large media files
|
||||
* Fixed an issue with status file being cached
|
||||
|
||||
= 4.17 =
|
||||
* Set "Tested up to" WordPress 4.4
|
||||
|
||||
= 4.16 =
|
||||
* Fix an issue with the transport layer on export/import
|
||||
|
||||
= 4.15 =
|
||||
* Fix an issue with resovling mechanism on export/import
|
||||
|
||||
= 4.14 =
|
||||
* Fix an issue with database import
|
||||
|
||||
= 4.13 =
|
||||
* Add new mechanism for resolving HTTP requests
|
||||
|
||||
= 4.12 =
|
||||
* Fix an issue with Google Drive extension
|
||||
|
||||
= 4.11 =
|
||||
* Fix content filters on export
|
||||
|
||||
= 4.10 =
|
||||
* Add HTTPS URL replacement
|
||||
* Fix an issue when PDO is not available
|
||||
|
||||
= 4.6 =
|
||||
* Fix an issue when the plugin was getting stuck on "Done creating an empty archive"
|
||||
* Fix an issue when the plugin was getting stuck during import
|
||||
|
||||
= 4.3 =
|
||||
* Add URL extension support
|
||||
* Filter "mu-plugins" directory if "Do not export plugins (files)" is checked
|
||||
* Fix utf8mb4 issue
|
||||
* Fix translation issue
|
||||
|
||||
= 4.2 =
|
||||
* Fix .wpress.bin format
|
||||
|
||||
= 4.1 =
|
||||
* Add port to the host header on export/import
|
||||
* Rename .wpress file to .wpress.bin file
|
||||
|
||||
= 4.0 =
|
||||
* Fix file permission checks
|
||||
|
||||
= 3.9 =
|
||||
* Fix could not resolve domain name on export/import
|
||||
|
||||
= 3.8 =
|
||||
* Fix undefined method on Backups page if PHP version is < 5.3.6
|
||||
|
||||
= 3.7 =
|
||||
* Add IPv6 support on export/import
|
||||
|
||||
= 3.6 =
|
||||
* Fixed undefined constant warnings
|
||||
|
||||
= 3.5 =
|
||||
* Exclude core plugin and extensions on export if they have custom names
|
||||
|
||||
= 3.4 =
|
||||
* Made export/import processes more reliable
|
||||
* Allow the plugin to work with non-default name
|
||||
* Preserve backups during plugin updates
|
||||
* Improved find & replace functionality on the serialized data
|
||||
* Removed backup file name restrictions
|
||||
|
||||
= 3.3 =
|
||||
* Fixed a bug when retrieving export/import status progress
|
||||
* Fixed a bug when database encoding utf8mb4_unicode_ci is not available
|
||||
|
||||
= 3.2.2 =
|
||||
* Fixed plugin incompatibility during export/import that was reporting that the process could not be started
|
||||
|
||||
= 3.2.1 =
|
||||
* Added username/password settings for WordPress sites behind HTTP basic authentication
|
||||
* Fixed a bug when exporting/importing without public DNS record
|
||||
* Fixed a bug when exporting/importing media files
|
||||
|
||||
= 3.2.0 =
|
||||
* Added advanced settings on export page
|
||||
|
||||
= 3.1.1 =
|
||||
* Fixed secret key issue on upgrade of the plugin
|
||||
|
||||
= 3.0.0 =
|
||||
* Added export to File, [Dropbox](https://servmask.com/products/dropbox-extension), [Amazon S3](https://servmask.com/products/amazon-s3-extension), [Google Drive](https://servmask.com/products/google-drive-extension)
|
||||
* Added import from File, [Dropbox](https://servmask.com/products/dropbox-extension), [Amazon S3](https://servmask.com/products/amazon-s3-extension), [Google Drive](https://servmask.com/products/google-drive-extension)
|
||||
* Implemented our own archiving format that reduces export and import by a factor of 10
|
||||
* One-click export with the new simplified export page
|
||||
* Improved upload functionality with auto-recognizing chunk size on import
|
||||
* New **Backups** page for storing all WordPress site exports
|
||||
* Easy restore WordPress site from **Backups** page
|
||||
* Monitoring availability of the disk space on the server
|
||||
* Both export and import happen in time chunks of 3 seconds
|
||||
* Plugin works behind HTTP basic authentication
|
||||
|
||||
= 2.0.4 =
|
||||
* Updated readme to reflect that the plugin is not multisite compatible
|
||||
|
||||
= 2.0.3 =
|
||||
* Fixed a security issue while importing site using regular users
|
||||
|
||||
= 2.0.2 =
|
||||
* Added support for WordPress v4.0
|
||||
|
||||
= 2.0.1 =
|
||||
* Fixed a bug when all user permissions are lost on import
|
||||
|
||||
= 2.0.0 =
|
||||
* Added support for migration of WordPress in Network Mode (Multi Site)
|
||||
* New improved UI and UX
|
||||
* New improved language translations on the menu items and help texts
|
||||
* Better error handling and notifications
|
||||
* Fixed a bug while exporting comments and associated comments meta data
|
||||
* Fixed a bug while using find/replace functionality
|
||||
* Fixed a bug with storage directory permissions and search indexation
|
||||
|
||||
= 1.9.2 =
|
||||
* Added PHP <= v5.2.7 compatibility
|
||||
|
||||
= 1.9.1 =
|
||||
* Fixed an issue with earlier versions of PHP
|
||||
|
||||
= 1.9.0 =
|
||||
* New improved design on the export/import page
|
||||
* Added an option for gathering user experience statistics
|
||||
* Added a message box with important notifications about the plugin
|
||||
* Fixed a bug while exporting database with multiple WordPress sites
|
||||
* Fixed a bug while exporting database with table constraints
|
||||
* Fixed a bug with auto recognizing zip archiver
|
||||
|
||||
= 1.8.1 =
|
||||
* Added "Get Support" link in the plugin list page
|
||||
* Removed "All-in-One WP Migration Beta" link from the readme file
|
||||
|
||||
= 1.8.0 =
|
||||
* Added support for dynamically recognizing Site URL and Home URL on the import page
|
||||
* Fixed a bug when maximum uploaded size is exceeded
|
||||
* Fixed a bug while exporting big database tables
|
||||
|
||||
= 1.7.2 =
|
||||
* Added support for automatically switching database adapters for better performance and optimization
|
||||
* Fixed a bug while using host:port syntax with MySQL PDO
|
||||
* Fixed a bug while using find/replace functionality
|
||||
|
||||
= 1.7.1 =
|
||||
* Fixed a bug while exporting WordPress plugins directory
|
||||
|
||||
= 1.7.0 =
|
||||
* Added storage layer to avoid permission issues with OS's directory used for temporary storage
|
||||
* Added additional checks to verify the consistency of the imported archive
|
||||
* Fixed a bug that caused the database to be exported without data
|
||||
* Removed unused variables from package.json file
|
||||
|
||||
= 1.6.0 =
|
||||
* Added additional check for directory's permissions
|
||||
* Added additional check for output buffering when exporting a file
|
||||
* Fixed a bug when the archive was exported or imported with old version of Zlib library
|
||||
* Fixed a bug with permalinks and flushing the rules
|
||||
|
||||
= 1.5.0 =
|
||||
* Added support for additional errors and exceptions handling
|
||||
* Added support for reporting a problem in better and easier way
|
||||
* Improved support process in ZenDesk system for faster response time
|
||||
* Fixed typos on the import page. Thanks to Terry Heenan
|
||||
|
||||
= 1.4.0 =
|
||||
* Added a Twitter and Facebook share buttons to the sidebar on import and export pages
|
||||
|
||||
= 1.3.1 =
|
||||
* Fixed a bug when the user was unable to import site archive
|
||||
* Optimized and speeded up import process
|
||||
|
||||
= 1.3.0 =
|
||||
* Added support for mysql connection to happen over sockets or TCP
|
||||
* Added support for Windows OS and fully tested the plugin on IIS
|
||||
* Added support for limited memory_limit - 1MB - The plugin now requires only 1MB to operate properly
|
||||
* Added support for multisite
|
||||
* Used mysql_unbuffered_query instead of mysql_query to overcome any memory problems
|
||||
* Fixed a deprecated warning for mysql_pconnect when php 5.5 and above is used
|
||||
* Fixed memory_limit problem with PCLZIP library
|
||||
* Fixed a bug when the archive is exported with zero size when using PCLZIP
|
||||
* Fixed a bug when the archive was exported broken on some servers
|
||||
* Fixed a deprecated usage of preg_replace \e in php v5.5 and above
|
||||
|
||||
= 1.2.1 =
|
||||
* Fixed an issue when HTTP Error was shown on some hosts after import, credit to Michael Simon
|
||||
* Fixed an issue when exporting databases with different prefix than wp_, credit to najtrox
|
||||
* Fixed an issue when PDO is avalable but mysql driver for PDO is not, credit to Jaydesain69
|
||||
* Deleted a plugin specific option when uninstalling the plugin (clean after itself)
|
||||
* Support is done via Zendesk
|
||||
* Included WP Version and Plugin version in the feedback form
|
||||
|
||||
= 1.2.0 =
|
||||
* Increased upload limit of files from 128MB to 512MB
|
||||
* Used ZipArchive with fallback to PclZip (a few users notified us that they don't have ZipArchive enabled on their servers)
|
||||
* Used PDO with fallback to mysql (a few users notified us that they dont have PDO enabled on their servers, mysql is deprecated as of PHP v5.5 but we are supporting PHP v5.2.17)
|
||||
* Supported PHP v5.2.17 and WordPress v3.3 and above
|
||||
* Fixed a bug during export that causes plugins to not be exported on some hosts (the problem that you are experiencing)
|
||||
|
||||
= 1.1.0 =
|
||||
* Importing files using chunks to overcome any webserver upload size restriction
|
||||
* Fixed a bug where HTTP code error was shown to some users
|
||||
|
||||
= 1.0.0 =
|
||||
* Export database as SQL file
|
||||
* Export media files
|
||||
* Export themes files
|
||||
* Export installed plugins
|
||||
* Unlimited find/replace actions
|
||||
* Option to exclude spam comments
|
||||
* Option to apply find/replace to GUIDs
|
||||
* Option to exclude post revisions
|
||||
* Option to exclude tables data
|
||||
1473
wp-content/plugins/all-in-one-wp-migration/constants.php
Normal file
1473
wp-content/plugins/all-in-one-wp-migration/constants.php
Normal file
File diff suppressed because it is too large
Load Diff
30
wp-content/plugins/all-in-one-wp-migration/deprecated.php
Normal file
30
wp-content/plugins/all-in-one-wp-migration/deprecated.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2014-2020 ServMask Inc.
|
||||
*
|
||||
* 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/>.
|
||||
*
|
||||
* ███████╗███████╗██████╗ ██╗ ██╗███╗ ███╗ █████╗ ███████╗██╗ ██╗
|
||||
* ██╔════╝██╔════╝██╔══██╗██║ ██║████╗ ████║██╔══██╗██╔════╝██║ ██╔╝
|
||||
* ███████╗█████╗ ██████╔╝██║ ██║██╔████╔██║███████║███████╗█████╔╝
|
||||
* ╚════██║██╔══╝ ██╔══██╗╚██╗ ██╔╝██║╚██╔╝██║██╔══██║╚════██║██╔═██╗
|
||||
* ███████║███████╗██║ ██║ ╚████╔╝ ██║ ╚═╝ ██║██║ ██║███████║██║ ██╗
|
||||
* ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
die( 'Kangaroos cannot jump here' );
|
||||
}
|
||||
|
||||
function ai1wm_progress_path( $params ) {}
|
||||
50
wp-content/plugins/all-in-one-wp-migration/exceptions.php
Normal file
50
wp-content/plugins/all-in-one-wp-migration/exceptions.php
Normal file
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2014-2020 ServMask Inc.
|
||||
*
|
||||
* 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/>.
|
||||
*
|
||||
* ███████╗███████╗██████╗ ██╗ ██╗███╗ ███╗ █████╗ ███████╗██╗ ██╗
|
||||
* ██╔════╝██╔════╝██╔══██╗██║ ██║████╗ ████║██╔══██╗██╔════╝██║ ██╔╝
|
||||
* ███████╗█████╗ ██████╔╝██║ ██║██╔████╔██║███████║███████╗█████╔╝
|
||||
* ╚════██║██╔══╝ ██╔══██╗╚██╗ ██╔╝██║╚██╔╝██║██╔══██║╚════██║██╔═██╗
|
||||
* ███████║███████╗██║ ██║ ╚████╔╝ ██║ ╚═╝ ██║██║ ██║███████║██║ ██╗
|
||||
* ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
die( 'Kangaroos cannot jump here' );
|
||||
}
|
||||
|
||||
class Ai1wm_Archive_Exception extends Exception {}
|
||||
class Ai1wm_Backups_Exception extends Exception {}
|
||||
class Ai1wm_Export_Exception extends Exception {}
|
||||
class Ai1wm_Http_Exception extends Exception {}
|
||||
class Ai1wm_Import_Exception extends Exception {}
|
||||
class Ai1wm_Import_Retry_Exception extends Exception {}
|
||||
class Ai1wm_Not_Accessible_Exception extends Exception {}
|
||||
class Ai1wm_Not_Seekable_Exception extends Exception {}
|
||||
class Ai1wm_Not_Tellable_Exception extends Exception {}
|
||||
class Ai1wm_Not_Readable_Exception extends Exception {}
|
||||
class Ai1wm_Not_Writable_Exception extends Exception {}
|
||||
class Ai1wm_Not_Truncatable_Exception extends Exception {}
|
||||
class Ai1wm_Not_Closable_Exception extends Exception {}
|
||||
class Ai1wm_Not_Found_Exception extends Exception {}
|
||||
class Ai1wm_Not_Directory_Exception extends Exception {}
|
||||
class Ai1wm_Not_Valid_Secret_Key_Exception extends Exception {}
|
||||
class Ai1wm_Quota_Exceeded_Exception extends Exception {}
|
||||
class Ai1wm_Storage_Exception extends Exception {}
|
||||
class Ai1wm_Compatibility_Exception extends Exception {}
|
||||
class Ai1wm_Feedback_Exception extends Exception {}
|
||||
class Ai1wm_Database_Exception extends Exception {}
|
||||
1884
wp-content/plugins/all-in-one-wp-migration/functions.php
Normal file
1884
wp-content/plugins/all-in-one-wp-migration/functions.php
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,157 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2014-2020 ServMask Inc.
|
||||
*
|
||||
* 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/>.
|
||||
*
|
||||
* ███████╗███████╗██████╗ ██╗ ██╗███╗ ███╗ █████╗ ███████╗██╗ ██╗
|
||||
* ██╔════╝██╔════╝██╔══██╗██║ ██║████╗ ████║██╔══██╗██╔════╝██║ ██╔╝
|
||||
* ███████╗█████╗ ██████╔╝██║ ██║██╔████╔██║███████║███████╗█████╔╝
|
||||
* ╚════██║██╔══╝ ██╔══██╗╚██╗ ██╔╝██║╚██╔╝██║██╔══██║╚════██║██╔═██╗
|
||||
* ███████║███████╗██║ ██║ ╚████╔╝ ██║ ╚═╝ ██║██║ ██║███████║██║ ██╗
|
||||
* ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
die( 'Kangaroos cannot jump here' );
|
||||
}
|
||||
|
||||
class Ai1wm_Backups_Controller {
|
||||
|
||||
public static function index() {
|
||||
Ai1wm_Template::render(
|
||||
'backups/index',
|
||||
array(
|
||||
'backups' => Ai1wm_Backups::get_files(),
|
||||
'labels' => Ai1wm_Backups::get_labels(),
|
||||
'username' => get_option( AI1WM_AUTH_USER ),
|
||||
'password' => get_option( AI1WM_AUTH_PASSWORD ),
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
public static function delete( $params = array() ) {
|
||||
ai1wm_setup_environment();
|
||||
|
||||
// Set params
|
||||
if ( empty( $params ) ) {
|
||||
$params = stripslashes_deep( $_POST );
|
||||
}
|
||||
|
||||
// Set secret key
|
||||
$secret_key = null;
|
||||
if ( isset( $params['secret_key'] ) ) {
|
||||
$secret_key = trim( $params['secret_key'] );
|
||||
}
|
||||
|
||||
// Set archive
|
||||
$archive = null;
|
||||
if ( isset( $params['archive'] ) ) {
|
||||
$archive = trim( $params['archive'] );
|
||||
}
|
||||
|
||||
try {
|
||||
// Ensure that unauthorized people cannot access delete action
|
||||
ai1wm_verify_secret_key( $secret_key );
|
||||
} catch ( Ai1wm_Not_Valid_Secret_Key_Exception $e ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
try {
|
||||
Ai1wm_Backups::delete_file( $archive );
|
||||
Ai1wm_Backups::delete_label( $archive );
|
||||
} catch ( Ai1wm_Backups_Exception $e ) {
|
||||
echo json_encode( array( 'errors' => array( $e->getMessage() ) ) );
|
||||
exit;
|
||||
}
|
||||
|
||||
echo json_encode( array( 'errors' => array() ) );
|
||||
exit;
|
||||
}
|
||||
|
||||
public static function add_label( $params = array() ) {
|
||||
ai1wm_setup_environment();
|
||||
|
||||
// Set params
|
||||
if ( empty( $params ) ) {
|
||||
$params = stripslashes_deep( $_POST );
|
||||
}
|
||||
|
||||
// Set secret key
|
||||
$secret_key = null;
|
||||
if ( isset( $params['secret_key'] ) ) {
|
||||
$secret_key = trim( $params['secret_key'] );
|
||||
}
|
||||
|
||||
// Set archive
|
||||
$archive = null;
|
||||
if ( isset( $params['archive'] ) ) {
|
||||
$archive = trim( $params['archive'] );
|
||||
}
|
||||
|
||||
// Set backup label
|
||||
$label = null;
|
||||
if ( isset( $params['label'] ) ) {
|
||||
$label = trim( $params['label'] );
|
||||
}
|
||||
|
||||
try {
|
||||
// Ensure that unauthorized people cannot access add label action
|
||||
ai1wm_verify_secret_key( $secret_key );
|
||||
} catch ( Ai1wm_Not_Valid_Secret_Key_Exception $e ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
try {
|
||||
Ai1wm_Backups::set_label( $archive, $label );
|
||||
} catch ( Ai1wm_Backups_Exception $e ) {
|
||||
echo json_encode( array( 'errors' => array( $e->getMessage() ) ) );
|
||||
exit;
|
||||
}
|
||||
|
||||
echo json_encode( array( 'errors' => array() ) );
|
||||
exit;
|
||||
}
|
||||
|
||||
public static function backup_list( $params = array() ) {
|
||||
ai1wm_setup_environment();
|
||||
|
||||
// Set params
|
||||
if ( empty( $params ) ) {
|
||||
$params = stripslashes_deep( $_GET );
|
||||
}
|
||||
|
||||
// Set secret key
|
||||
$secret_key = null;
|
||||
if ( isset( $params['secret_key'] ) ) {
|
||||
$secret_key = trim( $params['secret_key'] );
|
||||
}
|
||||
|
||||
try {
|
||||
// Ensure that unauthorized people cannot access backups list action
|
||||
ai1wm_verify_secret_key( $secret_key );
|
||||
} catch ( Ai1wm_Not_Valid_Secret_Key_Exception $e ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
Ai1wm_Template::render(
|
||||
'backups/backups-list',
|
||||
array(
|
||||
'backups' => Ai1wm_Backups::get_files(),
|
||||
'labels' => Ai1wm_Backups::get_labels(),
|
||||
)
|
||||
);
|
||||
exit;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,287 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2014-2020 ServMask Inc.
|
||||
*
|
||||
* 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/>.
|
||||
*
|
||||
* ███████╗███████╗██████╗ ██╗ ██╗███╗ ███╗ █████╗ ███████╗██╗ ██╗
|
||||
* ██╔════╝██╔════╝██╔══██╗██║ ██║████╗ ████║██╔══██╗██╔════╝██║ ██╔╝
|
||||
* ███████╗█████╗ ██████╔╝██║ ██║██╔████╔██║███████║███████╗█████╔╝
|
||||
* ╚════██║██╔══╝ ██╔══██╗╚██╗ ██╔╝██║╚██╔╝██║██╔══██║╚════██║██╔═██╗
|
||||
* ███████║███████╗██║ ██║ ╚████╔╝ ██║ ╚═╝ ██║██║ ██║███████║██║ ██╗
|
||||
* ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
die( 'Kangaroos cannot jump here' );
|
||||
}
|
||||
|
||||
class Ai1wm_Export_Controller {
|
||||
|
||||
public static function index() {
|
||||
Ai1wm_Template::render( 'export/index' );
|
||||
}
|
||||
|
||||
public static function export( $params = array() ) {
|
||||
ai1wm_setup_environment();
|
||||
|
||||
// Set params
|
||||
if ( empty( $params ) ) {
|
||||
$params = stripslashes_deep( array_merge( $_GET, $_POST ) );
|
||||
}
|
||||
|
||||
// Set priority
|
||||
if ( ! isset( $params['priority'] ) ) {
|
||||
$params['priority'] = 5;
|
||||
}
|
||||
|
||||
// Set secret key
|
||||
$secret_key = null;
|
||||
if ( isset( $params['secret_key'] ) ) {
|
||||
$secret_key = trim( $params['secret_key'] );
|
||||
}
|
||||
|
||||
try {
|
||||
// Ensure that unauthorized people cannot access export action
|
||||
ai1wm_verify_secret_key( $secret_key );
|
||||
} catch ( Ai1wm_Not_Valid_Secret_Key_Exception $e ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
// Loop over filters
|
||||
if ( ( $filters = ai1wm_get_filters( 'ai1wm_export' ) ) ) {
|
||||
while ( $hooks = current( $filters ) ) {
|
||||
if ( intval( $params['priority'] ) === key( $filters ) ) {
|
||||
foreach ( $hooks as $hook ) {
|
||||
try {
|
||||
|
||||
// Run function hook
|
||||
$params = call_user_func_array( $hook['function'], array( $params ) );
|
||||
|
||||
} catch ( Ai1wm_Database_Exception $e ) {
|
||||
if ( defined( 'WP_CLI' ) ) {
|
||||
WP_CLI::error( sprintf( __( 'Unable to export. Error code: %s. %s', AI1WM_PLUGIN_NAME ), $e->getCode(), $e->getMessage() ) );
|
||||
} else {
|
||||
status_header( $e->getCode() );
|
||||
echo json_encode( array( 'errors' => array( array( 'code' => $e->getCode(), 'message' => $e->getMessage() ) ) ) );
|
||||
}
|
||||
Ai1wm_Directory::delete( ai1wm_storage_path( $params ) );
|
||||
exit;
|
||||
} catch ( Exception $e ) {
|
||||
if ( defined( 'WP_CLI' ) ) {
|
||||
WP_CLI::error( sprintf( __( 'Unable to export: %s', AI1WM_PLUGIN_NAME ), $e->getMessage() ) );
|
||||
} else {
|
||||
Ai1wm_Status::error( __( 'Unable to export', AI1WM_PLUGIN_NAME ), $e->getMessage() );
|
||||
Ai1wm_Notification::error( __( 'Unable to export', AI1WM_PLUGIN_NAME ), $e->getMessage() );
|
||||
}
|
||||
Ai1wm_Directory::delete( ai1wm_storage_path( $params ) );
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
// Set completed
|
||||
$completed = true;
|
||||
if ( isset( $params['completed'] ) ) {
|
||||
$completed = (bool) $params['completed'];
|
||||
}
|
||||
|
||||
// Do request
|
||||
if ( $completed === false || ( $next = next( $filters ) ) && ( $params['priority'] = key( $filters ) ) ) {
|
||||
if ( defined( 'WP_CLI' ) ) {
|
||||
if ( ! defined( 'DOING_CRON' ) ) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if ( isset( $params['ai1wm_manual_export'] ) ) {
|
||||
echo json_encode( $params );
|
||||
exit;
|
||||
}
|
||||
|
||||
wp_remote_request(
|
||||
apply_filters( 'ai1wm_http_export_url', add_query_arg( array( 'ai1wm_import' => 1 ), admin_url( 'admin-ajax.php?action=ai1wm_export' ) ) ),
|
||||
array(
|
||||
'method' => apply_filters( 'ai1wm_http_export_method', 'POST' ),
|
||||
'timeout' => apply_filters( 'ai1wm_http_export_timeout', 10 ),
|
||||
'blocking' => apply_filters( 'ai1wm_http_export_blocking', false ),
|
||||
'sslverify' => apply_filters( 'ai1wm_http_export_sslverify', false ),
|
||||
'headers' => apply_filters( 'ai1wm_http_export_headers', array() ),
|
||||
'body' => apply_filters( 'ai1wm_http_export_body', $params ),
|
||||
)
|
||||
);
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
next( $filters );
|
||||
}
|
||||
}
|
||||
|
||||
return $params;
|
||||
}
|
||||
|
||||
public static function buttons() {
|
||||
$active_filters = array();
|
||||
$static_filters = array();
|
||||
|
||||
// All-in-One WP Migration
|
||||
if ( defined( 'AI1WM_PLUGIN_NAME' ) ) {
|
||||
$active_filters[] = apply_filters( 'ai1wm_export_file', Ai1wm_Template::get_content( 'export/button-file' ) );
|
||||
} else {
|
||||
$static_filters[] = apply_filters( 'ai1wm_export_file', Ai1wm_Template::get_content( 'export/button-file' ) );
|
||||
}
|
||||
|
||||
// Add FTP Extension
|
||||
if ( defined( 'AI1WMFE_PLUGIN_NAME' ) ) {
|
||||
$active_filters[] = apply_filters( 'ai1wm_export_ftp', Ai1wm_Template::get_content( 'export/button-ftp' ) );
|
||||
} else {
|
||||
$static_filters[] = apply_filters( 'ai1wm_export_ftp', Ai1wm_Template::get_content( 'export/button-ftp' ) );
|
||||
}
|
||||
|
||||
// Add Dropbox Extension
|
||||
if ( defined( 'AI1WMDE_PLUGIN_NAME' ) ) {
|
||||
$active_filters[] = apply_filters( 'ai1wm_export_dropbox', Ai1wm_Template::get_content( 'export/button-dropbox' ) );
|
||||
} else {
|
||||
$static_filters[] = apply_filters( 'ai1wm_export_dropbox', Ai1wm_Template::get_content( 'export/button-dropbox' ) );
|
||||
}
|
||||
|
||||
// Add Google Drive Extension
|
||||
if ( defined( 'AI1WMGE_PLUGIN_NAME' ) ) {
|
||||
$active_filters[] = apply_filters( 'ai1wm_export_gdrive', Ai1wm_Template::get_content( 'export/button-gdrive' ) );
|
||||
} else {
|
||||
$static_filters[] = apply_filters( 'ai1wm_export_gdrive', Ai1wm_Template::get_content( 'export/button-gdrive' ) );
|
||||
}
|
||||
|
||||
// Add Amazon S3 Extension
|
||||
if ( defined( 'AI1WMSE_PLUGIN_NAME' ) ) {
|
||||
$active_filters[] = apply_filters( 'ai1wm_export_s3', Ai1wm_Template::get_content( 'export/button-s3' ) );
|
||||
} else {
|
||||
$static_filters[] = apply_filters( 'ai1wm_export_s3', Ai1wm_Template::get_content( 'export/button-s3' ) );
|
||||
}
|
||||
|
||||
// Add Backblaze B2 Extension
|
||||
if ( defined( 'AI1WMAE_PLUGIN_NAME' ) ) {
|
||||
$active_filters[] = apply_filters( 'ai1wm_export_b2', Ai1wm_Template::get_content( 'export/button-b2' ) );
|
||||
} else {
|
||||
$static_filters[] = apply_filters( 'ai1wm_export_b2', Ai1wm_Template::get_content( 'export/button-b2' ) );
|
||||
}
|
||||
|
||||
// Add OneDrive Extension
|
||||
if ( defined( 'AI1WMOE_PLUGIN_NAME' ) ) {
|
||||
$active_filters[] = apply_filters( 'ai1wm_export_onedrive', Ai1wm_Template::get_content( 'export/button-onedrive' ) );
|
||||
} else {
|
||||
$static_filters[] = apply_filters( 'ai1wm_export_onedrive', Ai1wm_Template::get_content( 'export/button-onedrive' ) );
|
||||
}
|
||||
|
||||
// Add Box Extension
|
||||
if ( defined( 'AI1WMBE_PLUGIN_NAME' ) ) {
|
||||
$active_filters[] = apply_filters( 'ai1wm_export_box', Ai1wm_Template::get_content( 'export/button-box' ) );
|
||||
} else {
|
||||
$static_filters[] = apply_filters( 'ai1wm_export_box', Ai1wm_Template::get_content( 'export/button-box' ) );
|
||||
}
|
||||
|
||||
// Add Mega Extension
|
||||
if ( defined( 'AI1WMEE_PLUGIN_NAME' ) ) {
|
||||
$active_filters[] = apply_filters( 'ai1wm_export_mega', Ai1wm_Template::get_content( 'export/button-mega' ) );
|
||||
} else {
|
||||
$static_filters[] = apply_filters( 'ai1wm_export_mega', Ai1wm_Template::get_content( 'export/button-mega' ) );
|
||||
}
|
||||
|
||||
// Add DigitalOcean Spaces Extension
|
||||
if ( defined( 'AI1WMIE_PLUGIN_NAME' ) ) {
|
||||
$active_filters[] = apply_filters( 'ai1wm_export_digitalocean', Ai1wm_Template::get_content( 'export/button-digitalocean' ) );
|
||||
} else {
|
||||
$static_filters[] = apply_filters( 'ai1wm_export_digitalocean', Ai1wm_Template::get_content( 'export/button-digitalocean' ) );
|
||||
}
|
||||
|
||||
// Add Google Cloud Storage Extension
|
||||
if ( defined( 'AI1WMCE_PLUGIN_NAME' ) ) {
|
||||
$active_filters[] = apply_filters( 'ai1wm_export_gcloud_storage', Ai1wm_Template::get_content( 'export/button-gcloud-storage' ) );
|
||||
} else {
|
||||
$static_filters[] = apply_filters( 'ai1wm_export_gcloud_storage', Ai1wm_Template::get_content( 'export/button-gcloud-storage' ) );
|
||||
}
|
||||
|
||||
// Add Microsoft Azure Extension
|
||||
if ( defined( 'AI1WMZE_PLUGIN_NAME' ) ) {
|
||||
$active_filters[] = apply_filters( 'ai1wm_export_azure_storage', Ai1wm_Template::get_content( 'export/button-azure-storage' ) );
|
||||
} else {
|
||||
$static_filters[] = apply_filters( 'ai1wm_export_azure_storage', Ai1wm_Template::get_content( 'export/button-azure-storage' ) );
|
||||
}
|
||||
|
||||
// Add Amazon Glacier Extension
|
||||
if ( defined( 'AI1WMRE_PLUGIN_NAME' ) ) {
|
||||
$active_filters[] = apply_filters( 'ai1wm_export_glacier', Ai1wm_Template::get_content( 'export/button-glacier' ) );
|
||||
} else {
|
||||
$static_filters[] = apply_filters( 'ai1wm_export_glacier', Ai1wm_Template::get_content( 'export/button-glacier' ) );
|
||||
}
|
||||
|
||||
// Add pCloud Extension
|
||||
if ( defined( 'AI1WMPE_PLUGIN_NAME' ) ) {
|
||||
$active_filters[] = apply_filters( 'ai1wm_export_pcloud', Ai1wm_Template::get_content( 'export/button-pcloud' ) );
|
||||
} else {
|
||||
$static_filters[] = apply_filters( 'ai1wm_export_pcloud', Ai1wm_Template::get_content( 'export/button-pcloud' ) );
|
||||
}
|
||||
|
||||
// Add WebDAV Extension
|
||||
if ( defined( 'AI1WMWE_PLUGIN_NAME' ) ) {
|
||||
$active_filters[] = apply_filters( 'ai1wm_export_webdav', Ai1wm_Template::get_content( 'export/button-webdav' ) );
|
||||
} else {
|
||||
$static_filters[] = apply_filters( 'ai1wm_export_webdav', Ai1wm_Template::get_content( 'export/button-webdav' ) );
|
||||
}
|
||||
|
||||
// Add S3 Client Extension
|
||||
if ( defined( 'AI1WMNE_PLUGIN_NAME' ) ) {
|
||||
$active_filters[] = apply_filters( 'ai1wm_export_s3_client', Ai1wm_Template::get_content( 'export/button-s3-client' ) );
|
||||
} else {
|
||||
$static_filters[] = apply_filters( 'ai1wm_export_s3_client', Ai1wm_Template::get_content( 'export/button-s3-client' ) );
|
||||
}
|
||||
|
||||
return array_merge( $active_filters, $static_filters );
|
||||
}
|
||||
|
||||
public static function http_export_headers( $headers = array() ) {
|
||||
if ( ( $user = get_option( AI1WM_AUTH_USER ) ) && ( $password = get_option( AI1WM_AUTH_PASSWORD ) ) ) {
|
||||
if ( ( $hash = base64_encode( sprintf( '%s:%s', $user, $password ) ) ) ) {
|
||||
$headers['Authorization'] = sprintf( 'Basic %s', $hash );
|
||||
}
|
||||
}
|
||||
|
||||
return $headers;
|
||||
}
|
||||
|
||||
public static function cleanup() {
|
||||
try {
|
||||
// Iterate over storage directory
|
||||
$iterator = new Ai1wm_Recursive_Directory_Iterator( AI1WM_STORAGE_PATH );
|
||||
|
||||
// Exclude index.php
|
||||
$iterator = new Ai1wm_Recursive_Exclude_Filter( $iterator, array( 'index.php' ) );
|
||||
|
||||
// Loop over folders and files
|
||||
foreach ( $iterator as $item ) {
|
||||
try {
|
||||
if ( $item->getMTime() < ( time() - AI1WM_MAX_STORAGE_CLEANUP ) ) {
|
||||
if ( $item->isDir() ) {
|
||||
Ai1wm_Directory::delete( $item->getPathname() );
|
||||
} else {
|
||||
Ai1wm_File::delete( $item->getPathname() );
|
||||
}
|
||||
}
|
||||
} catch ( Exception $e ) {
|
||||
}
|
||||
}
|
||||
} catch ( Exception $e ) {
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,101 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2014-2020 ServMask Inc.
|
||||
*
|
||||
* 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/>.
|
||||
*
|
||||
* ███████╗███████╗██████╗ ██╗ ██╗███╗ ███╗ █████╗ ███████╗██╗ ██╗
|
||||
* ██╔════╝██╔════╝██╔══██╗██║ ██║████╗ ████║██╔══██╗██╔════╝██║ ██╔╝
|
||||
* ███████╗█████╗ ██████╔╝██║ ██║██╔████╔██║███████║███████╗█████╔╝
|
||||
* ╚════██║██╔══╝ ██╔══██╗╚██╗ ██╔╝██║╚██╔╝██║██╔══██║╚════██║██╔═██╗
|
||||
* ███████║███████╗██║ ██║ ╚████╔╝ ██║ ╚═╝ ██║██║ ██║███████║██║ ██╗
|
||||
* ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
die( 'Kangaroos cannot jump here' );
|
||||
}
|
||||
|
||||
class Ai1wm_Feedback_Controller {
|
||||
|
||||
public static function feedback( $params = array() ) {
|
||||
ai1wm_setup_environment();
|
||||
|
||||
// Set params
|
||||
if ( empty( $params ) ) {
|
||||
$params = stripslashes_deep( $_POST );
|
||||
}
|
||||
|
||||
// Set secret key
|
||||
$secret_key = null;
|
||||
if ( isset( $params['secret_key'] ) ) {
|
||||
$secret_key = trim( $params['secret_key'] );
|
||||
}
|
||||
|
||||
// Set type
|
||||
$type = null;
|
||||
if ( isset( $params['ai1wm_type'] ) ) {
|
||||
$type = trim( $params['ai1wm_type'] );
|
||||
}
|
||||
|
||||
// Set e-mail
|
||||
$email = null;
|
||||
if ( isset( $params['ai1wm_email'] ) ) {
|
||||
$email = trim( $params['ai1wm_email'] );
|
||||
}
|
||||
|
||||
// Set message
|
||||
$message = null;
|
||||
if ( isset( $params['ai1wm_message'] ) ) {
|
||||
$message = trim( $params['ai1wm_message'] );
|
||||
}
|
||||
|
||||
// Set terms
|
||||
$terms = false;
|
||||
if ( isset( $params['ai1wm_terms'] ) ) {
|
||||
$terms = (bool) $params['ai1wm_terms'];
|
||||
}
|
||||
|
||||
try {
|
||||
// Ensure that unauthorized people cannot access feedback action
|
||||
ai1wm_verify_secret_key( $secret_key );
|
||||
} catch ( Ai1wm_Not_Valid_Secret_Key_Exception $e ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
$extensions = Ai1wm_Extensions::get();
|
||||
|
||||
// Exclude File Extension
|
||||
if ( defined( 'AI1WMTE_PLUGIN_NAME' ) ) {
|
||||
unset( $extensions[ AI1WMTE_PLUGIN_NAME ] );
|
||||
}
|
||||
|
||||
$purchases = array();
|
||||
foreach ( $extensions as $extension ) {
|
||||
if ( ( $uuid = get_option( $extension['key'] ) ) ) {
|
||||
$purchases[] = $uuid;
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
Ai1wm_Feedback::add( $type, $email, $message, $terms, implode( PHP_EOL, $purchases ) );
|
||||
} catch ( Ai1wm_Feedback_Exception $e ) {
|
||||
echo json_encode( array( 'errors' => array( $e->getMessage() ) ) );
|
||||
exit;
|
||||
}
|
||||
|
||||
echo json_encode( array( 'errors' => array() ) );
|
||||
exit;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,289 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2014-2020 ServMask Inc.
|
||||
*
|
||||
* 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/>.
|
||||
*
|
||||
* ███████╗███████╗██████╗ ██╗ ██╗███╗ ███╗ █████╗ ███████╗██╗ ██╗
|
||||
* ██╔════╝██╔════╝██╔══██╗██║ ██║████╗ ████║██╔══██╗██╔════╝██║ ██╔╝
|
||||
* ███████╗█████╗ ██████╔╝██║ ██║██╔████╔██║███████║███████╗█████╔╝
|
||||
* ╚════██║██╔══╝ ██╔══██╗╚██╗ ██╔╝██║╚██╔╝██║██╔══██║╚════██║██╔═██╗
|
||||
* ███████║███████╗██║ ██║ ╚████╔╝ ██║ ╚═╝ ██║██║ ██║███████║██║ ██╗
|
||||
* ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
die( 'Kangaroos cannot jump here' );
|
||||
}
|
||||
|
||||
class Ai1wm_Import_Controller {
|
||||
|
||||
public static function index() {
|
||||
Ai1wm_Template::render( 'import/index' );
|
||||
}
|
||||
|
||||
public static function import( $params = array() ) {
|
||||
ai1wm_setup_environment();
|
||||
|
||||
// Set params
|
||||
if ( empty( $params ) ) {
|
||||
$params = stripslashes_deep( array_merge( $_GET, $_POST ) );
|
||||
}
|
||||
|
||||
// Set priority
|
||||
if ( ! isset( $params['priority'] ) ) {
|
||||
$params['priority'] = 10;
|
||||
}
|
||||
|
||||
// Set secret key
|
||||
$secret_key = null;
|
||||
if ( isset( $params['secret_key'] ) ) {
|
||||
$secret_key = trim( $params['secret_key'] );
|
||||
}
|
||||
|
||||
try {
|
||||
// Ensure that unauthorized people cannot access import action
|
||||
ai1wm_verify_secret_key( $secret_key );
|
||||
} catch ( Ai1wm_Not_Valid_Secret_Key_Exception $e ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
// Loop over filters
|
||||
if ( ( $filters = ai1wm_get_filters( 'ai1wm_import' ) ) ) {
|
||||
while ( $hooks = current( $filters ) ) {
|
||||
if ( intval( $params['priority'] ) === key( $filters ) ) {
|
||||
foreach ( $hooks as $hook ) {
|
||||
try {
|
||||
|
||||
// Run function hook
|
||||
$params = call_user_func_array( $hook['function'], array( $params ) );
|
||||
|
||||
} catch ( Ai1wm_Import_Retry_Exception $e ) {
|
||||
if ( defined( 'WP_CLI' ) ) {
|
||||
WP_CLI::error( sprintf( __( 'Unable to import. Error code: %s. %s', AI1WM_PLUGIN_NAME ), $e->getCode(), $e->getMessage() ) );
|
||||
} else {
|
||||
status_header( $e->getCode() );
|
||||
echo json_encode( array( 'errors' => array( array( 'code' => $e->getCode(), 'message' => $e->getMessage() ) ) ) );
|
||||
}
|
||||
exit;
|
||||
} catch ( Ai1wm_Database_Exception $e ) {
|
||||
if ( defined( 'WP_CLI' ) ) {
|
||||
WP_CLI::error( sprintf( __( 'Unable to import. Error code: %s. %s', AI1WM_PLUGIN_NAME ), $e->getCode(), $e->getMessage() ) );
|
||||
} else {
|
||||
status_header( $e->getCode() );
|
||||
echo json_encode( array( 'errors' => array( array( 'code' => $e->getCode(), 'message' => $e->getMessage() ) ) ) );
|
||||
}
|
||||
Ai1wm_Directory::delete( ai1wm_storage_path( $params ) );
|
||||
exit;
|
||||
} catch ( Exception $e ) {
|
||||
if ( defined( 'WP_CLI' ) ) {
|
||||
WP_CLI::error( sprintf( __( 'Unable to import: %s', AI1WM_PLUGIN_NAME ), $e->getMessage() ) );
|
||||
} else {
|
||||
Ai1wm_Status::error( __( 'Unable to import', AI1WM_PLUGIN_NAME ), $e->getMessage() );
|
||||
Ai1wm_Notification::error( __( 'Unable to import', AI1WM_PLUGIN_NAME ), $e->getMessage() );
|
||||
}
|
||||
Ai1wm_Directory::delete( ai1wm_storage_path( $params ) );
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
// Set completed
|
||||
$completed = true;
|
||||
if ( isset( $params['completed'] ) ) {
|
||||
$completed = (bool) $params['completed'];
|
||||
}
|
||||
|
||||
// Do request
|
||||
if ( $completed === false || ( $next = next( $filters ) ) && ( $params['priority'] = key( $filters ) ) ) {
|
||||
if ( defined( 'WP_CLI' ) ) {
|
||||
if ( ! defined( 'DOING_CRON' ) ) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if ( isset( $params['ai1wm_manual_import'] ) || isset( $params['ai1wm_manual_restore'] ) ) {
|
||||
echo json_encode( $params );
|
||||
exit;
|
||||
}
|
||||
|
||||
wp_remote_request(
|
||||
apply_filters( 'ai1wm_http_import_url', add_query_arg( array( 'ai1wm_import' => 1 ), admin_url( 'admin-ajax.php?action=ai1wm_import' ) ) ),
|
||||
array(
|
||||
'method' => apply_filters( 'ai1wm_http_import_method', 'POST' ),
|
||||
'timeout' => apply_filters( 'ai1wm_http_import_timeout', 10 ),
|
||||
'blocking' => apply_filters( 'ai1wm_http_import_blocking', false ),
|
||||
'sslverify' => apply_filters( 'ai1wm_http_import_sslverify', false ),
|
||||
'headers' => apply_filters( 'ai1wm_http_import_headers', array() ),
|
||||
'body' => apply_filters( 'ai1wm_http_import_body', $params ),
|
||||
)
|
||||
);
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
next( $filters );
|
||||
}
|
||||
}
|
||||
|
||||
return $params;
|
||||
}
|
||||
|
||||
public static function buttons() {
|
||||
$active_filters = array();
|
||||
$static_filters = array();
|
||||
|
||||
// All-in-One WP Migration
|
||||
if ( defined( 'AI1WM_PLUGIN_NAME' ) ) {
|
||||
$active_filters[] = apply_filters( 'ai1wm_import_file', Ai1wm_Template::get_content( 'import/button-file' ) );
|
||||
} else {
|
||||
$static_filters[] = apply_filters( 'ai1wm_import_file', Ai1wm_Template::get_content( 'import/button-file' ) );
|
||||
}
|
||||
|
||||
// Add URL Extension
|
||||
if ( defined( 'AI1WMLE_PLUGIN_NAME' ) ) {
|
||||
$active_filters[] = apply_filters( 'ai1wm_import_url', Ai1wm_Template::get_content( 'import/button-url' ) );
|
||||
} else {
|
||||
$static_filters[] = apply_filters( 'ai1wm_import_url', Ai1wm_Template::get_content( 'import/button-url' ) );
|
||||
}
|
||||
|
||||
// Add FTP Extension
|
||||
if ( defined( 'AI1WMFE_PLUGIN_NAME' ) ) {
|
||||
$active_filters[] = apply_filters( 'ai1wm_import_ftp', Ai1wm_Template::get_content( 'import/button-ftp' ) );
|
||||
} else {
|
||||
$static_filters[] = apply_filters( 'ai1wm_import_ftp', Ai1wm_Template::get_content( 'import/button-ftp' ) );
|
||||
}
|
||||
|
||||
// Add Dropbox Extension
|
||||
if ( defined( 'AI1WMDE_PLUGIN_NAME' ) ) {
|
||||
$active_filters[] = apply_filters( 'ai1wm_import_dropbox', Ai1wm_Template::get_content( 'import/button-dropbox' ) );
|
||||
} else {
|
||||
$static_filters[] = apply_filters( 'ai1wm_import_dropbox', Ai1wm_Template::get_content( 'import/button-dropbox' ) );
|
||||
}
|
||||
|
||||
// Add Google Drive Extension
|
||||
if ( defined( 'AI1WMGE_PLUGIN_NAME' ) ) {
|
||||
$active_filters[] = apply_filters( 'ai1wm_import_gdrive', Ai1wm_Template::get_content( 'import/button-gdrive' ) );
|
||||
} else {
|
||||
$static_filters[] = apply_filters( 'ai1wm_import_gdrive', Ai1wm_Template::get_content( 'import/button-gdrive' ) );
|
||||
}
|
||||
|
||||
// Add Amazon S3 Extension
|
||||
if ( defined( 'AI1WMSE_PLUGIN_NAME' ) ) {
|
||||
$active_filters[] = apply_filters( 'ai1wm_import_s3', Ai1wm_Template::get_content( 'import/button-s3' ) );
|
||||
} else {
|
||||
$static_filters[] = apply_filters( 'ai1wm_import_s3', Ai1wm_Template::get_content( 'import/button-s3' ) );
|
||||
}
|
||||
|
||||
// Add Backblaze B2 Extension
|
||||
if ( defined( 'AI1WMAE_PLUGIN_NAME' ) ) {
|
||||
$active_filters[] = apply_filters( 'ai1wm_import_b2', Ai1wm_Template::get_content( 'import/button-b2' ) );
|
||||
} else {
|
||||
$static_filters[] = apply_filters( 'ai1wm_import_b2', Ai1wm_Template::get_content( 'import/button-b2' ) );
|
||||
}
|
||||
|
||||
// Add OneDrive Extension
|
||||
if ( defined( 'AI1WMOE_PLUGIN_NAME' ) ) {
|
||||
$active_filters[] = apply_filters( 'ai1wm_import_onedrive', Ai1wm_Template::get_content( 'import/button-onedrive' ) );
|
||||
} else {
|
||||
$static_filters[] = apply_filters( 'ai1wm_import_onedrive', Ai1wm_Template::get_content( 'import/button-onedrive' ) );
|
||||
}
|
||||
|
||||
// Add Box Extension
|
||||
if ( defined( 'AI1WMBE_PLUGIN_NAME' ) ) {
|
||||
$active_filters[] = apply_filters( 'ai1wm_import_box', Ai1wm_Template::get_content( 'import/button-box' ) );
|
||||
} else {
|
||||
$static_filters[] = apply_filters( 'ai1wm_import_box', Ai1wm_Template::get_content( 'import/button-box' ) );
|
||||
}
|
||||
|
||||
// Add Mega Extension
|
||||
if ( defined( 'AI1WMEE_PLUGIN_NAME' ) ) {
|
||||
$active_filters[] = apply_filters( 'ai1wm_import_mega', Ai1wm_Template::get_content( 'import/button-mega' ) );
|
||||
} else {
|
||||
$static_filters[] = apply_filters( 'ai1wm_import_mega', Ai1wm_Template::get_content( 'import/button-mega' ) );
|
||||
}
|
||||
|
||||
// Add DigitalOcean Spaces Extension
|
||||
if ( defined( 'AI1WMIE_PLUGIN_NAME' ) ) {
|
||||
$active_filters[] = apply_filters( 'ai1wm_import_digitalocean', Ai1wm_Template::get_content( 'import/button-digitalocean' ) );
|
||||
} else {
|
||||
$static_filters[] = apply_filters( 'ai1wm_import_digitalocean', Ai1wm_Template::get_content( 'import/button-digitalocean' ) );
|
||||
}
|
||||
|
||||
// Add Google Cloud Storage Extension
|
||||
if ( defined( 'AI1WMCE_PLUGIN_NAME' ) ) {
|
||||
$active_filters[] = apply_filters( 'ai1wm_import_gcloud_storage', Ai1wm_Template::get_content( 'import/button-gcloud-storage' ) );
|
||||
} else {
|
||||
$static_filters[] = apply_filters( 'ai1wm_import_gcloud_storage', Ai1wm_Template::get_content( 'import/button-gcloud-storage' ) );
|
||||
}
|
||||
|
||||
// Add Microsoft Azure Extension
|
||||
if ( defined( 'AI1WMZE_PLUGIN_NAME' ) ) {
|
||||
$active_filters[] = apply_filters( 'ai1wm_import_azure_storage', Ai1wm_Template::get_content( 'import/button-azure-storage' ) );
|
||||
} else {
|
||||
$static_filters[] = apply_filters( 'ai1wm_import_azure_storage', Ai1wm_Template::get_content( 'import/button-azure-storage' ) );
|
||||
}
|
||||
|
||||
// Add Amazon Glacier Extension
|
||||
if ( defined( 'AI1WMRE_PLUGIN_NAME' ) ) {
|
||||
$active_filters[] = apply_filters( 'ai1wm_import_glacier', Ai1wm_Template::get_content( 'import/button-glacier' ) );
|
||||
} else {
|
||||
$static_filters[] = apply_filters( 'ai1wm_import_glacier', Ai1wm_Template::get_content( 'import/button-glacier' ) );
|
||||
}
|
||||
|
||||
// Add pCloud Extension
|
||||
if ( defined( 'AI1WMPE_PLUGIN_NAME' ) ) {
|
||||
$active_filters[] = apply_filters( 'ai1wm_import_pcloud', Ai1wm_Template::get_content( 'import/button-pcloud' ) );
|
||||
} else {
|
||||
$static_filters[] = apply_filters( 'ai1wm_import_pcloud', Ai1wm_Template::get_content( 'import/button-pcloud' ) );
|
||||
}
|
||||
|
||||
// Add WebDAV Extension
|
||||
if ( defined( 'AI1WMWE_PLUGIN_NAME' ) ) {
|
||||
$active_filters[] = apply_filters( 'ai1wm_import_webdav', Ai1wm_Template::get_content( 'import/button-webdav' ) );
|
||||
} else {
|
||||
$static_filters[] = apply_filters( 'ai1wm_import_webdav', Ai1wm_Template::get_content( 'import/button-webdav' ) );
|
||||
}
|
||||
|
||||
// Add S3 Client Extension
|
||||
if ( defined( 'AI1WMNE_PLUGIN_NAME' ) ) {
|
||||
$active_filters[] = apply_filters( 'ai1wm_import_s3_client', Ai1wm_Template::get_content( 'import/button-s3-client' ) );
|
||||
} else {
|
||||
$static_filters[] = apply_filters( 'ai1wm_import_s3_client', Ai1wm_Template::get_content( 'import/button-s3-client' ) );
|
||||
}
|
||||
|
||||
return array_merge( $active_filters, $static_filters );
|
||||
}
|
||||
|
||||
public static function pro() {
|
||||
return Ai1wm_Template::get_content( 'import/pro' );
|
||||
}
|
||||
|
||||
public static function http_import_headers( $headers = array() ) {
|
||||
if ( ( $user = get_option( AI1WM_AUTH_USER ) ) && ( $password = get_option( AI1WM_AUTH_PASSWORD ) ) ) {
|
||||
if ( ( $hash = base64_encode( sprintf( '%s:%s', $user, $password ) ) ) ) {
|
||||
$headers['Authorization'] = sprintf( 'Basic %s', $hash );
|
||||
}
|
||||
}
|
||||
|
||||
return $headers;
|
||||
}
|
||||
|
||||
public static function max_chunk_size() {
|
||||
return min(
|
||||
ai1wm_parse_size( ini_get( 'post_max_size' ), AI1WM_MAX_CHUNK_SIZE ),
|
||||
ai1wm_parse_size( ini_get( 'upload_max_filesize' ), AI1WM_MAX_CHUNK_SIZE ),
|
||||
ai1wm_parse_size( AI1WM_MAX_CHUNK_SIZE )
|
||||
);
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,56 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2014-2020 ServMask Inc.
|
||||
*
|
||||
* 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/>.
|
||||
*
|
||||
* ███████╗███████╗██████╗ ██╗ ██╗███╗ ███╗ █████╗ ███████╗██╗ ██╗
|
||||
* ██╔════╝██╔════╝██╔══██╗██║ ██║████╗ ████║██╔══██╗██╔════╝██║ ██╔╝
|
||||
* ███████╗█████╗ ██████╔╝██║ ██║██╔████╔██║███████║███████╗█████╔╝
|
||||
* ╚════██║██╔══╝ ██╔══██╗╚██╗ ██╔╝██║╚██╔╝██║██╔══██║╚════██║██╔═██╗
|
||||
* ███████║███████╗██║ ██║ ╚████╔╝ ██║ ╚═╝ ██║██║ ██║███████║██║ ██╗
|
||||
* ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
die( 'Kangaroos cannot jump here' );
|
||||
}
|
||||
|
||||
class Ai1wm_Status_Controller {
|
||||
|
||||
public static function status( $params = array() ) {
|
||||
ai1wm_setup_environment();
|
||||
|
||||
// Set params
|
||||
if ( empty( $params ) ) {
|
||||
$params = stripslashes_deep( $_GET );
|
||||
}
|
||||
|
||||
// Set secret key
|
||||
$secret_key = null;
|
||||
if ( isset( $params['secret_key'] ) ) {
|
||||
$secret_key = trim( $params['secret_key'] );
|
||||
}
|
||||
|
||||
try {
|
||||
// Ensure that unauthorized people cannot access status action
|
||||
ai1wm_verify_secret_key( $secret_key );
|
||||
} catch ( Ai1wm_Not_Valid_Secret_Key_Exception $e ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
echo json_encode( get_option( AI1WM_STATUS, array() ) );
|
||||
exit;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,107 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2014-2020 ServMask Inc.
|
||||
*
|
||||
* 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/>.
|
||||
*
|
||||
* ███████╗███████╗██████╗ ██╗ ██╗███╗ ███╗ █████╗ ███████╗██╗ ██╗
|
||||
* ██╔════╝██╔════╝██╔══██╗██║ ██║████╗ ████║██╔══██╗██╔════╝██║ ██╔╝
|
||||
* ███████╗█████╗ ██████╔╝██║ ██║██╔████╔██║███████║███████╗█████╔╝
|
||||
* ╚════██║██╔══╝ ██╔══██╗╚██╗ ██╔╝██║╚██╔╝██║██╔══██║╚════██║██╔═██╗
|
||||
* ███████║███████╗██║ ██║ ╚████╔╝ ██║ ╚═╝ ██║██║ ██║███████║██║ ██╗
|
||||
* ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
die( 'Kangaroos cannot jump here' );
|
||||
}
|
||||
|
||||
class Ai1wm_Updater_Controller {
|
||||
|
||||
public static function plugins_api( $result, $action = null, $args = null ) {
|
||||
return Ai1wm_Updater::plugins_api( $result, $action, $args );
|
||||
}
|
||||
|
||||
public static function pre_update_plugins( $transient ) {
|
||||
if ( empty( $transient->checked ) ) {
|
||||
return $transient;
|
||||
}
|
||||
|
||||
// Check for updates every 11 hours
|
||||
if ( ( $last_check_for_updates = get_site_transient( AI1WM_LAST_CHECK_FOR_UPDATES ) ) ) {
|
||||
if ( ( time() - $last_check_for_updates ) < 11 * HOUR_IN_SECONDS ) {
|
||||
return $transient;
|
||||
}
|
||||
}
|
||||
|
||||
// Set last check for updates
|
||||
set_site_transient( AI1WM_LAST_CHECK_FOR_UPDATES, time() );
|
||||
|
||||
// Check for updates
|
||||
Ai1wm_Updater::check_for_updates();
|
||||
|
||||
return $transient;
|
||||
}
|
||||
|
||||
public static function update_plugins( $transient ) {
|
||||
return Ai1wm_Updater::update_plugins( $transient );
|
||||
}
|
||||
|
||||
public static function check_for_updates() {
|
||||
return Ai1wm_Updater::check_for_updates();
|
||||
}
|
||||
|
||||
public static function plugin_row_meta( $plugin_meta, $plugin_file ) {
|
||||
return Ai1wm_Updater::plugin_row_meta( $plugin_meta, $plugin_file );
|
||||
}
|
||||
|
||||
public static function in_plugin_update_message( $plugin_data, $response ) {
|
||||
$updater = get_option( AI1WM_UPDATER, array() );
|
||||
|
||||
// Get updater details
|
||||
if ( isset( $updater[ $plugin_data['slug'] ]['update_message'] ) ) {
|
||||
Ai1wm_Template::render( 'updater/update', array( 'message' => $updater[ $plugin_data['slug'] ]['update_message'] ) );
|
||||
}
|
||||
}
|
||||
|
||||
public static function updater( $params = array() ) {
|
||||
if ( check_ajax_referer( 'ai1wm_updater', 'ai1wm_nonce' ) ) {
|
||||
ai1wm_setup_environment();
|
||||
|
||||
// Set params
|
||||
if ( empty( $params ) ) {
|
||||
$params = stripslashes_deep( $_POST );
|
||||
}
|
||||
|
||||
// Set uuid
|
||||
$uuid = null;
|
||||
if ( isset( $params['ai1wm_uuid'] ) ) {
|
||||
$uuid = trim( $params['ai1wm_uuid'] );
|
||||
}
|
||||
|
||||
// Set extension
|
||||
$extension = null;
|
||||
if ( isset( $params['ai1wm_extension'] ) ) {
|
||||
$extension = trim( $params['ai1wm_extension'] );
|
||||
}
|
||||
|
||||
$extensions = Ai1wm_Extensions::get();
|
||||
|
||||
// Verify whether extension exists
|
||||
if ( isset( $extensions[ $extension ] ) ) {
|
||||
update_option( $extensions[ $extension ]['key'], $uuid );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,152 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2014-2020 ServMask Inc.
|
||||
*
|
||||
* 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/>.
|
||||
*
|
||||
* ███████╗███████╗██████╗ ██╗ ██╗███╗ ███╗ █████╗ ███████╗██╗ ██╗
|
||||
* ██╔════╝██╔════╝██╔══██╗██║ ██║████╗ ████║██╔══██╗██╔════╝██║ ██╔╝
|
||||
* ███████╗█████╗ ██████╔╝██║ ██║██╔████╔██║███████║███████╗█████╔╝
|
||||
* ╚════██║██╔══╝ ██╔══██╗╚██╗ ██╔╝██║╚██╔╝██║██╔══██║╚════██║██╔═██╗
|
||||
* ███████║███████╗██║ ██║ ╚████╔╝ ██║ ╚═╝ ██║██║ ██║███████║██║ ██╗
|
||||
* ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
die( 'Kangaroos cannot jump here' );
|
||||
}
|
||||
|
||||
class Ai1wm_Backups {
|
||||
|
||||
/**
|
||||
* Get all backup files
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function get_files() {
|
||||
$backups = array();
|
||||
|
||||
try {
|
||||
|
||||
// Iterate over directory
|
||||
$iterator = new Ai1wm_Recursive_Directory_Iterator( AI1WM_BACKUPS_PATH );
|
||||
|
||||
// Filter by extensions
|
||||
$iterator = new Ai1wm_Recursive_Extension_Filter( $iterator, array( 'wpress' ) );
|
||||
|
||||
// Recursively iterate over directory
|
||||
$iterator = new Ai1wm_Recursive_Iterator_Iterator( $iterator, RecursiveIteratorIterator::LEAVES_ONLY, RecursiveIteratorIterator::CATCH_GET_CHILD );
|
||||
|
||||
// Get backup files
|
||||
foreach ( $iterator as $item ) {
|
||||
try {
|
||||
if ( ai1wm_is_filesize_supported( $item->getPathname() ) ) {
|
||||
$backups[] = array(
|
||||
'path' => $iterator->getSubPath(),
|
||||
'filename' => $iterator->getSubPathname(),
|
||||
'mtime' => $iterator->getMTime(),
|
||||
'size' => $iterator->getSize(),
|
||||
);
|
||||
} else {
|
||||
$backups[] = array(
|
||||
'path' => $iterator->getSubPath(),
|
||||
'filename' => $iterator->getSubPathname(),
|
||||
'mtime' => $iterator->getMTime(),
|
||||
'size' => null,
|
||||
);
|
||||
}
|
||||
} catch ( Exception $e ) {
|
||||
$backups[] = array(
|
||||
'path' => $iterator->getSubPath(),
|
||||
'filename' => $iterator->getSubPathname(),
|
||||
'mtime' => null,
|
||||
'size' => null,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// Sort backups modified date
|
||||
usort( $backups, 'Ai1wm_Backups::compare' );
|
||||
|
||||
} catch ( Exception $e ) {
|
||||
}
|
||||
|
||||
return $backups;
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete backup file
|
||||
*
|
||||
* @param string $file File name
|
||||
* @return boolean
|
||||
*/
|
||||
public static function delete_file( $file ) {
|
||||
if ( validate_file( $file ) === 0 ) {
|
||||
return @unlink( ai1wm_backup_path( array( 'archive' => $file ) ) );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all backup labels
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function get_labels() {
|
||||
return get_option( AI1WM_BACKUPS_LABELS, array() );
|
||||
}
|
||||
|
||||
/**
|
||||
* Set backup label
|
||||
*
|
||||
* @param string $file File name
|
||||
* @param string $label File label
|
||||
* @return boolean
|
||||
*/
|
||||
public static function set_label( $file, $label ) {
|
||||
if ( ( $labels = get_option( AI1WM_BACKUPS_LABELS, array() ) ) !== false ) {
|
||||
$labels[ $file ] = $label;
|
||||
}
|
||||
|
||||
return update_option( AI1WM_BACKUPS_LABELS, $labels );
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete backup label
|
||||
*
|
||||
* @param string $file File name
|
||||
* @return boolean
|
||||
*/
|
||||
public static function delete_label( $file ) {
|
||||
if ( ( $labels = get_option( AI1WM_BACKUPS_LABELS, array() ) ) !== false ) {
|
||||
unset( $labels[ $file ] );
|
||||
}
|
||||
|
||||
return update_option( AI1WM_BACKUPS_LABELS, $labels );
|
||||
}
|
||||
|
||||
/**
|
||||
* Compare backup files by modified time
|
||||
*
|
||||
* @param array $a File item A
|
||||
* @param array $b File item B
|
||||
* @return integer
|
||||
*/
|
||||
public static function compare( $a, $b ) {
|
||||
if ( $a['mtime'] === $b['mtime'] ) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return ( $a['mtime'] > $b['mtime'] ) ? - 1 : 1;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2014-2020 ServMask Inc.
|
||||
*
|
||||
* 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/>.
|
||||
*
|
||||
* ███████╗███████╗██████╗ ██╗ ██╗███╗ ███╗ █████╗ ███████╗██╗ ██╗
|
||||
* ██╔════╝██╔════╝██╔══██╗██║ ██║████╗ ████║██╔══██╗██╔════╝██║ ██╔╝
|
||||
* ███████╗█████╗ ██████╔╝██║ ██║██╔████╔██║███████║███████╗█████╔╝
|
||||
* ╚════██║██╔══╝ ██╔══██╗╚██╗ ██╔╝██║╚██╔╝██║██╔══██║╚════██║██╔═██╗
|
||||
* ███████║███████╗██║ ██║ ╚████╔╝ ██║ ╚═╝ ██║██║ ██║███████║██║ ██╗
|
||||
* ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
die( 'Kangaroos cannot jump here' );
|
||||
}
|
||||
|
||||
class Ai1wm_Compatibility {
|
||||
|
||||
public static function get( $params ) {
|
||||
$extensions = Ai1wm_Extensions::get();
|
||||
|
||||
foreach ( $extensions as $extension_name => $extension_data ) {
|
||||
if ( ! isset( $params[ $extension_data['short'] ] ) ) {
|
||||
unset( $extensions[ $extension_name ] );
|
||||
}
|
||||
}
|
||||
|
||||
// If no extension is used, update everything that is available
|
||||
if ( empty( $extensions ) ) {
|
||||
$extensions = Ai1wm_Extensions::get();
|
||||
}
|
||||
|
||||
$messages = array();
|
||||
foreach ( $extensions as $extension_name => $extension_data ) {
|
||||
if ( ! Ai1wm_Compatibility::check( $extension_data ) ) {
|
||||
if ( defined( 'WP_CLI' ) ) {
|
||||
$messages[] = sprintf( __( '%s is not the latest version. You must update the plugin before you can use it. ', AI1WM_PLUGIN_NAME ), $extension_data['title'] );
|
||||
} else {
|
||||
$messages[] = sprintf( __( '<strong>%s</strong> is not the latest version. You must <a href="%s">update the plugin</a> before you can use it. <br />', AI1WM_PLUGIN_NAME ), $extension_data['title'], network_admin_url( 'plugins.php' ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $messages;
|
||||
}
|
||||
|
||||
public static function check( $extension ) {
|
||||
if ( $extension['version'] !== 'develop' ) {
|
||||
if ( version_compare( $extension['version'], $extension['requires'], '<' ) ) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2014-2020 ServMask Inc.
|
||||
*
|
||||
* 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/>.
|
||||
*
|
||||
* ███████╗███████╗██████╗ ██╗ ██╗███╗ ███╗ █████╗ ███████╗██╗ ██╗
|
||||
* ██╔════╝██╔════╝██╔══██╗██║ ██║████╗ ████║██╔══██╗██╔════╝██║ ██╔╝
|
||||
* ███████╗█████╗ ██████╔╝██║ ██║██╔████╔██║███████║███████╗█████╔╝
|
||||
* ╚════██║██╔══╝ ██╔══██╗╚██╗ ██╔╝██║╚██╔╝██║██╔══██║╚════██║██╔═██╗
|
||||
* ███████║███████╗██║ ██║ ╚████╔╝ ██║ ╚═╝ ██║██║ ██║███████║██║ ██╗
|
||||
* ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
die( 'Kangaroos cannot jump here' );
|
||||
}
|
||||
|
||||
class Ai1wm_Export_Abstract {}
|
||||
class Ai1wm_Import_Abstract {}
|
||||
class Ai1wm_Config {}
|
||||
@@ -0,0 +1,350 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2014-2020 ServMask Inc.
|
||||
*
|
||||
* 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/>.
|
||||
*
|
||||
* ███████╗███████╗██████╗ ██╗ ██╗███╗ ███╗ █████╗ ███████╗██╗ ██╗
|
||||
* ██╔════╝██╔════╝██╔══██╗██║ ██║████╗ ████║██╔══██╗██╔════╝██║ ██╔╝
|
||||
* ███████╗█████╗ ██████╔╝██║ ██║██╔████╔██║███████║███████╗█████╔╝
|
||||
* ╚════██║██╔══╝ ██╔══██╗╚██╗ ██╔╝██║╚██╔╝██║██╔══██║╚════██║██╔═██╗
|
||||
* ███████║███████╗██║ ██║ ╚████╔╝ ██║ ╚═╝ ██║██║ ██║███████║██║ ██╗
|
||||
* ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
die( 'Kangaroos cannot jump here' );
|
||||
}
|
||||
|
||||
class Ai1wm_Extensions {
|
||||
|
||||
/**
|
||||
* Get active extensions
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function get() {
|
||||
$extensions = array();
|
||||
|
||||
// Add Microsoft Azure Extension
|
||||
if ( defined( 'AI1WMZE_PLUGIN_NAME' ) ) {
|
||||
$extensions[ AI1WMZE_PLUGIN_NAME ] = array(
|
||||
'key' => AI1WMZE_PLUGIN_KEY,
|
||||
'title' => AI1WMZE_PLUGIN_TITLE,
|
||||
'about' => AI1WMZE_PLUGIN_ABOUT,
|
||||
'check' => AI1WMZE_PLUGIN_CHECK,
|
||||
'basename' => AI1WMZE_PLUGIN_BASENAME,
|
||||
'version' => AI1WMZE_VERSION,
|
||||
'requires' => '1.19',
|
||||
'short' => AI1WMZE_PLUGIN_SHORT,
|
||||
);
|
||||
}
|
||||
|
||||
// Add Backblaze B2 Extension
|
||||
if ( defined( 'AI1WMAE_PLUGIN_NAME' ) ) {
|
||||
$extensions[ AI1WMAE_PLUGIN_NAME ] = array(
|
||||
'key' => AI1WMAE_PLUGIN_KEY,
|
||||
'title' => AI1WMAE_PLUGIN_TITLE,
|
||||
'about' => AI1WMAE_PLUGIN_ABOUT,
|
||||
'check' => AI1WMAE_PLUGIN_CHECK,
|
||||
'basename' => AI1WMAE_PLUGIN_BASENAME,
|
||||
'version' => AI1WMAE_VERSION,
|
||||
'requires' => '1.23',
|
||||
'short' => AI1WMAE_PLUGIN_SHORT,
|
||||
);
|
||||
}
|
||||
|
||||
// Add Backup Plugin
|
||||
if ( defined( 'AI1WMVE_PLUGIN_NAME' ) ) {
|
||||
$extensions[ AI1WMVE_PLUGIN_NAME ] = array(
|
||||
'key' => AI1WMVE_PLUGIN_KEY,
|
||||
'title' => AI1WMVE_PLUGIN_TITLE,
|
||||
'about' => AI1WMVE_PLUGIN_ABOUT,
|
||||
'check' => AI1WMVE_PLUGIN_CHECK,
|
||||
'basename' => AI1WMVE_PLUGIN_BASENAME,
|
||||
'version' => AI1WMVE_VERSION,
|
||||
'requires' => '1.0',
|
||||
'short' => AI1WMVE_PLUGIN_SHORT,
|
||||
);
|
||||
}
|
||||
|
||||
// Add Box Extension
|
||||
if ( defined( 'AI1WMBE_PLUGIN_NAME' ) ) {
|
||||
$extensions[ AI1WMBE_PLUGIN_NAME ] = array(
|
||||
'key' => AI1WMBE_PLUGIN_KEY,
|
||||
'title' => AI1WMBE_PLUGIN_TITLE,
|
||||
'about' => AI1WMBE_PLUGIN_ABOUT,
|
||||
'check' => AI1WMBE_PLUGIN_CHECK,
|
||||
'basename' => AI1WMBE_PLUGIN_BASENAME,
|
||||
'version' => AI1WMBE_VERSION,
|
||||
'requires' => '1.31',
|
||||
'short' => AI1WMBE_PLUGIN_SHORT,
|
||||
);
|
||||
}
|
||||
|
||||
// Add DigitalOcean Spaces Extension
|
||||
if ( defined( 'AI1WMIE_PLUGIN_NAME' ) ) {
|
||||
$extensions[ AI1WMIE_PLUGIN_NAME ] = array(
|
||||
'key' => AI1WMIE_PLUGIN_KEY,
|
||||
'title' => AI1WMIE_PLUGIN_TITLE,
|
||||
'about' => AI1WMIE_PLUGIN_ABOUT,
|
||||
'check' => AI1WMIE_PLUGIN_CHECK,
|
||||
'basename' => AI1WMIE_PLUGIN_BASENAME,
|
||||
'version' => AI1WMIE_VERSION,
|
||||
'requires' => '1.30',
|
||||
'short' => AI1WMIE_PLUGIN_SHORT,
|
||||
);
|
||||
}
|
||||
|
||||
// Add Direct Extension
|
||||
if ( defined( 'AI1WMXE_PLUGIN_NAME' ) ) {
|
||||
$extensions[ AI1WMXE_PLUGIN_NAME ] = array(
|
||||
'key' => AI1WMXE_PLUGIN_KEY,
|
||||
'title' => AI1WMXE_PLUGIN_TITLE,
|
||||
'about' => AI1WMXE_PLUGIN_ABOUT,
|
||||
'check' => AI1WMXE_PLUGIN_CHECK,
|
||||
'basename' => AI1WMXE_PLUGIN_BASENAME,
|
||||
'version' => AI1WMXE_VERSION,
|
||||
'requires' => '1.0',
|
||||
'short' => AI1WMXE_PLUGIN_SHORT,
|
||||
);
|
||||
}
|
||||
|
||||
// Add Dropbox Extension
|
||||
if ( defined( 'AI1WMDE_PLUGIN_NAME' ) ) {
|
||||
$extensions[ AI1WMDE_PLUGIN_NAME ] = array(
|
||||
'key' => AI1WMDE_PLUGIN_KEY,
|
||||
'title' => AI1WMDE_PLUGIN_TITLE,
|
||||
'about' => AI1WMDE_PLUGIN_ABOUT,
|
||||
'check' => AI1WMDE_PLUGIN_CHECK,
|
||||
'basename' => AI1WMDE_PLUGIN_BASENAME,
|
||||
'version' => AI1WMDE_VERSION,
|
||||
'requires' => '3.64',
|
||||
'short' => AI1WMDE_PLUGIN_SHORT,
|
||||
);
|
||||
}
|
||||
|
||||
// Add File Extension
|
||||
if ( defined( 'AI1WMTE_PLUGIN_NAME' ) ) {
|
||||
$extensions[ AI1WMTE_PLUGIN_NAME ] = array(
|
||||
'key' => AI1WMTE_PLUGIN_KEY,
|
||||
'title' => AI1WMTE_PLUGIN_TITLE,
|
||||
'about' => AI1WMTE_PLUGIN_ABOUT,
|
||||
'check' => AI1WMTE_PLUGIN_CHECK,
|
||||
'basename' => AI1WMTE_PLUGIN_BASENAME,
|
||||
'version' => AI1WMTE_VERSION,
|
||||
'requires' => '1.5',
|
||||
'short' => AI1WMTE_PLUGIN_SHORT,
|
||||
);
|
||||
}
|
||||
|
||||
// Add FTP Extension
|
||||
if ( defined( 'AI1WMFE_PLUGIN_NAME' ) ) {
|
||||
$extensions[ AI1WMFE_PLUGIN_NAME ] = array(
|
||||
'key' => AI1WMFE_PLUGIN_KEY,
|
||||
'title' => AI1WMFE_PLUGIN_TITLE,
|
||||
'about' => AI1WMFE_PLUGIN_ABOUT,
|
||||
'check' => AI1WMFE_PLUGIN_CHECK,
|
||||
'basename' => AI1WMFE_PLUGIN_BASENAME,
|
||||
'version' => AI1WMFE_VERSION,
|
||||
'requires' => '2.55',
|
||||
'short' => AI1WMFE_PLUGIN_SHORT,
|
||||
);
|
||||
}
|
||||
|
||||
// Add Google Cloud Storage Extension
|
||||
if ( defined( 'AI1WMCE_PLUGIN_NAME' ) ) {
|
||||
$extensions[ AI1WMCE_PLUGIN_NAME ] = array(
|
||||
'key' => AI1WMCE_PLUGIN_KEY,
|
||||
'title' => AI1WMCE_PLUGIN_TITLE,
|
||||
'about' => AI1WMCE_PLUGIN_ABOUT,
|
||||
'check' => AI1WMCE_PLUGIN_CHECK,
|
||||
'basename' => AI1WMCE_PLUGIN_BASENAME,
|
||||
'version' => AI1WMCE_VERSION,
|
||||
'requires' => '1.20',
|
||||
'short' => AI1WMCE_PLUGIN_SHORT,
|
||||
);
|
||||
}
|
||||
|
||||
// Add Google Drive Extension
|
||||
if ( defined( 'AI1WMGE_PLUGIN_NAME' ) ) {
|
||||
$extensions[ AI1WMGE_PLUGIN_NAME ] = array(
|
||||
'key' => AI1WMGE_PLUGIN_KEY,
|
||||
'title' => AI1WMGE_PLUGIN_TITLE,
|
||||
'about' => AI1WMGE_PLUGIN_ABOUT,
|
||||
'check' => AI1WMGE_PLUGIN_CHECK,
|
||||
'basename' => AI1WMGE_PLUGIN_BASENAME,
|
||||
'version' => AI1WMGE_VERSION,
|
||||
'requires' => '2.68',
|
||||
'short' => AI1WMGE_PLUGIN_SHORT,
|
||||
);
|
||||
}
|
||||
|
||||
// Add Amazon Glacier Extension
|
||||
if ( defined( 'AI1WMRE_PLUGIN_NAME' ) ) {
|
||||
$extensions[ AI1WMRE_PLUGIN_NAME ] = array(
|
||||
'key' => AI1WMRE_PLUGIN_KEY,
|
||||
'title' => AI1WMRE_PLUGIN_TITLE,
|
||||
'about' => AI1WMRE_PLUGIN_ABOUT,
|
||||
'check' => AI1WMRE_PLUGIN_CHECK,
|
||||
'basename' => AI1WMRE_PLUGIN_BASENAME,
|
||||
'version' => AI1WMRE_VERSION,
|
||||
'requires' => '1.19',
|
||||
'short' => AI1WMRE_PLUGIN_SHORT,
|
||||
);
|
||||
}
|
||||
|
||||
// Add Mega Extension
|
||||
if ( defined( 'AI1WMEE_PLUGIN_NAME' ) ) {
|
||||
$extensions[ AI1WMEE_PLUGIN_NAME ] = array(
|
||||
'key' => AI1WMEE_PLUGIN_KEY,
|
||||
'title' => AI1WMEE_PLUGIN_TITLE,
|
||||
'about' => AI1WMEE_PLUGIN_ABOUT,
|
||||
'check' => AI1WMEE_PLUGIN_CHECK,
|
||||
'basename' => AI1WMEE_PLUGIN_BASENAME,
|
||||
'version' => AI1WMEE_VERSION,
|
||||
'requires' => '1.28',
|
||||
'short' => AI1WMEE_PLUGIN_SHORT,
|
||||
);
|
||||
}
|
||||
|
||||
// Add Multisite Extension
|
||||
if ( defined( 'AI1WMME_PLUGIN_NAME' ) ) {
|
||||
$extensions[ AI1WMME_PLUGIN_NAME ] = array(
|
||||
'key' => AI1WMME_PLUGIN_KEY,
|
||||
'title' => AI1WMME_PLUGIN_TITLE,
|
||||
'about' => AI1WMME_PLUGIN_ABOUT,
|
||||
'check' => AI1WMME_PLUGIN_CHECK,
|
||||
'basename' => AI1WMME_PLUGIN_BASENAME,
|
||||
'version' => AI1WMME_VERSION,
|
||||
'requires' => '4.17',
|
||||
'short' => AI1WMME_PLUGIN_SHORT,
|
||||
);
|
||||
}
|
||||
|
||||
// Add OneDrive Extension
|
||||
if ( defined( 'AI1WMOE_PLUGIN_NAME' ) ) {
|
||||
$extensions[ AI1WMOE_PLUGIN_NAME ] = array(
|
||||
'key' => AI1WMOE_PLUGIN_KEY,
|
||||
'title' => AI1WMOE_PLUGIN_TITLE,
|
||||
'about' => AI1WMOE_PLUGIN_ABOUT,
|
||||
'check' => AI1WMOE_PLUGIN_CHECK,
|
||||
'basename' => AI1WMOE_PLUGIN_BASENAME,
|
||||
'version' => AI1WMOE_VERSION,
|
||||
'requires' => '1.42',
|
||||
'short' => AI1WMOE_PLUGIN_SHORT,
|
||||
);
|
||||
}
|
||||
|
||||
// Add pCloud Extension
|
||||
if ( defined( 'AI1WMPE_PLUGIN_NAME' ) ) {
|
||||
$extensions[ AI1WMPE_PLUGIN_NAME ] = array(
|
||||
'key' => AI1WMPE_PLUGIN_KEY,
|
||||
'title' => AI1WMPE_PLUGIN_TITLE,
|
||||
'about' => AI1WMPE_PLUGIN_ABOUT,
|
||||
'check' => AI1WMPE_PLUGIN_CHECK,
|
||||
'basename' => AI1WMPE_PLUGIN_BASENAME,
|
||||
'version' => AI1WMPE_VERSION,
|
||||
'requires' => '1.17',
|
||||
'short' => AI1WMPE_PLUGIN_SHORT,
|
||||
);
|
||||
}
|
||||
|
||||
// Add Pro Plugin
|
||||
if ( defined( 'AI1WMKE_PLUGIN_NAME' ) ) {
|
||||
$extensions[ AI1WMKE_PLUGIN_NAME ] = array(
|
||||
'key' => AI1WMKE_PLUGIN_KEY,
|
||||
'title' => AI1WMKE_PLUGIN_TITLE,
|
||||
'about' => AI1WMKE_PLUGIN_ABOUT,
|
||||
'check' => AI1WMKE_PLUGIN_CHECK,
|
||||
'basename' => AI1WMKE_PLUGIN_BASENAME,
|
||||
'version' => AI1WMKE_VERSION,
|
||||
'requires' => '1.0',
|
||||
'short' => AI1WMKE_PLUGIN_SHORT,
|
||||
);
|
||||
}
|
||||
|
||||
// Add S3 Client Extension
|
||||
if ( defined( 'AI1WMNE_PLUGIN_NAME' ) ) {
|
||||
$extensions[ AI1WMNE_PLUGIN_NAME ] = array(
|
||||
'key' => AI1WMNE_PLUGIN_KEY,
|
||||
'title' => AI1WMNE_PLUGIN_TITLE,
|
||||
'about' => AI1WMNE_PLUGIN_ABOUT,
|
||||
'check' => AI1WMNE_PLUGIN_CHECK,
|
||||
'basename' => AI1WMNE_PLUGIN_BASENAME,
|
||||
'version' => AI1WMNE_VERSION,
|
||||
'requires' => '1.14',
|
||||
'short' => AI1WMNE_PLUGIN_SHORT,
|
||||
);
|
||||
}
|
||||
|
||||
// Add Amazon S3 Extension
|
||||
if ( defined( 'AI1WMSE_PLUGIN_NAME' ) ) {
|
||||
$extensions[ AI1WMSE_PLUGIN_NAME ] = array(
|
||||
'key' => AI1WMSE_PLUGIN_KEY,
|
||||
'title' => AI1WMSE_PLUGIN_TITLE,
|
||||
'about' => AI1WMSE_PLUGIN_ABOUT,
|
||||
'check' => AI1WMSE_PLUGIN_CHECK,
|
||||
'basename' => AI1WMSE_PLUGIN_BASENAME,
|
||||
'version' => AI1WMSE_VERSION,
|
||||
'requires' => '3.48',
|
||||
'short' => AI1WMSE_PLUGIN_SHORT,
|
||||
);
|
||||
}
|
||||
|
||||
// Add Unlimited Extension
|
||||
if ( defined( 'AI1WMUE_PLUGIN_NAME' ) ) {
|
||||
$extensions[ AI1WMUE_PLUGIN_NAME ] = array(
|
||||
'key' => AI1WMUE_PLUGIN_KEY,
|
||||
'title' => AI1WMUE_PLUGIN_TITLE,
|
||||
'about' => AI1WMUE_PLUGIN_ABOUT,
|
||||
'check' => AI1WMUE_PLUGIN_CHECK,
|
||||
'basename' => AI1WMUE_PLUGIN_BASENAME,
|
||||
'version' => AI1WMUE_VERSION,
|
||||
'requires' => '2.31',
|
||||
'short' => AI1WMUE_PLUGIN_SHORT,
|
||||
);
|
||||
}
|
||||
|
||||
// Add URL Extension
|
||||
if ( defined( 'AI1WMLE_PLUGIN_NAME' ) ) {
|
||||
$extensions[ AI1WMLE_PLUGIN_NAME ] = array(
|
||||
'key' => AI1WMLE_PLUGIN_KEY,
|
||||
'title' => AI1WMLE_PLUGIN_TITLE,
|
||||
'about' => AI1WMLE_PLUGIN_ABOUT,
|
||||
'check' => AI1WMLE_PLUGIN_CHECK,
|
||||
'basename' => AI1WMLE_PLUGIN_BASENAME,
|
||||
'version' => AI1WMLE_VERSION,
|
||||
'requires' => '2.41',
|
||||
'short' => AI1WMLE_PLUGIN_SHORT,
|
||||
);
|
||||
}
|
||||
|
||||
// Add WebDAV Extension
|
||||
if ( defined( 'AI1WMWE_PLUGIN_NAME' ) ) {
|
||||
$extensions[ AI1WMWE_PLUGIN_NAME ] = array(
|
||||
'key' => AI1WMWE_PLUGIN_KEY,
|
||||
'title' => AI1WMWE_PLUGIN_TITLE,
|
||||
'about' => AI1WMWE_PLUGIN_ABOUT,
|
||||
'check' => AI1WMWE_PLUGIN_CHECK,
|
||||
'basename' => AI1WMWE_PLUGIN_BASENAME,
|
||||
'version' => AI1WMWE_VERSION,
|
||||
'requires' => '1.16',
|
||||
'short' => AI1WMWE_PLUGIN_SHORT,
|
||||
);
|
||||
}
|
||||
|
||||
return $extensions;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2014-2020 ServMask Inc.
|
||||
*
|
||||
* 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/>.
|
||||
*
|
||||
* ███████╗███████╗██████╗ ██╗ ██╗███╗ ███╗ █████╗ ███████╗██╗ ██╗
|
||||
* ██╔════╝██╔════╝██╔══██╗██║ ██║████╗ ████║██╔══██╗██╔════╝██║ ██╔╝
|
||||
* ███████╗█████╗ ██████╔╝██║ ██║██╔████╔██║███████║███████╗█████╔╝
|
||||
* ╚════██║██╔══╝ ██╔══██╗╚██╗ ██╔╝██║╚██╔╝██║██╔══██║╚════██║██╔═██╗
|
||||
* ███████║███████╗██║ ██║ ╚████╔╝ ██║ ╚═╝ ██║██║ ██║███████║██║ ██╗
|
||||
* ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
die( 'Kangaroos cannot jump here' );
|
||||
}
|
||||
|
||||
class Ai1wm_Feedback {
|
||||
|
||||
/**
|
||||
* Submit customer feedback to servmask.com
|
||||
*
|
||||
* @param string $type Feedback type
|
||||
* @param string $email User e-mail
|
||||
* @param string $message User message
|
||||
* @param integer $terms User accept terms
|
||||
* @param string $purchases Purchases IDs
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function add( $type, $email, $message, $terms, $purchases ) {
|
||||
// Validate email
|
||||
if ( filter_var( $email, FILTER_VALIDATE_EMAIL ) === false ) {
|
||||
throw new Ai1wm_Feedback_Exception( __( 'Your email is not valid.', AI1WM_PLUGIN_NAME ) );
|
||||
}
|
||||
|
||||
// Validate type
|
||||
if ( empty( $type ) ) {
|
||||
throw new Ai1wm_Feedback_Exception( __( 'Feedback type is not valid.', AI1WM_PLUGIN_NAME ) );
|
||||
}
|
||||
|
||||
// Validate message
|
||||
if ( empty( $message ) ) {
|
||||
throw new Ai1wm_Feedback_Exception( __( 'Please enter comments in the text area.', AI1WM_PLUGIN_NAME ) );
|
||||
}
|
||||
|
||||
// Validate terms
|
||||
if ( empty( $terms ) ) {
|
||||
throw new Ai1wm_Feedback_Exception( __( 'Please accept feedback term conditions.', AI1WM_PLUGIN_NAME ) );
|
||||
}
|
||||
|
||||
$response = wp_remote_post(
|
||||
AI1WM_FEEDBACK_URL,
|
||||
array(
|
||||
'timeout' => 15,
|
||||
'body' => array(
|
||||
'type' => $type,
|
||||
'email' => $email,
|
||||
'message' => $message,
|
||||
'purchases' => $purchases,
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
if ( is_wp_error( $response ) ) {
|
||||
throw new Ai1wm_Feedback_Exception( sprintf( __( 'Something went wrong: %s', AI1WM_PLUGIN_NAME ), $response->get_error_message() ) );
|
||||
}
|
||||
|
||||
return $response;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2014-2020 ServMask Inc.
|
||||
*
|
||||
* 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/>.
|
||||
*
|
||||
* ███████╗███████╗██████╗ ██╗ ██╗███╗ ███╗ █████╗ ███████╗██╗ ██╗
|
||||
* ██╔════╝██╔════╝██╔══██╗██║ ██║████╗ ████║██╔══██╗██╔════╝██║ ██╔╝
|
||||
* ███████╗█████╗ ██████╔╝██║ ██║██╔████╔██║███████║███████╗█████╔╝
|
||||
* ╚════██║██╔══╝ ██╔══██╗╚██╗ ██╔╝██║╚██╔╝██║██╔══██║╚════██║██╔═██╗
|
||||
* ███████║███████╗██║ ██║ ╚████╔╝ ██║ ╚═╝ ██║██║ ██║███████║██║ ██╗
|
||||
* ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
die( 'Kangaroos cannot jump here' );
|
||||
}
|
||||
|
||||
class Ai1wm_Handler {
|
||||
|
||||
/**
|
||||
* Error handler
|
||||
*
|
||||
* @param integer $errno Error level
|
||||
* @param string $errstr Error message
|
||||
* @param string $errfile Error file
|
||||
* @param integer $errline Error line
|
||||
* @return void
|
||||
*/
|
||||
public static function error( $errno, $errstr, $errfile, $errline ) {
|
||||
Ai1wm_Log::error(
|
||||
array(
|
||||
'Number' => $errno,
|
||||
'Message' => $errstr,
|
||||
'File' => $errfile,
|
||||
'Line' => $errline,
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Shutdown handler
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public static function shutdown() {
|
||||
if ( ( $error = error_get_last() ) ) {
|
||||
Ai1wm_Log::error( $error );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2014-2020 ServMask Inc.
|
||||
*
|
||||
* 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/>.
|
||||
*
|
||||
* ███████╗███████╗██████╗ ██╗ ██╗███╗ ███╗ █████╗ ███████╗██╗ ██╗
|
||||
* ██╔════╝██╔════╝██╔══██╗██║ ██║████╗ ████║██╔══██╗██╔════╝██║ ██╔╝
|
||||
* ███████╗█████╗ ██████╔╝██║ ██║██╔████╔██║███████║███████╗█████╔╝
|
||||
* ╚════██║██╔══╝ ██╔══██╗╚██╗ ██╔╝██║╚██╔╝██║██╔══██║╚════██║██╔═██╗
|
||||
* ███████║███████╗██║ ██║ ╚████╔╝ ██║ ╚═╝ ██║██║ ██║███████║██║ ██╗
|
||||
* ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
die( 'Kangaroos cannot jump here' );
|
||||
}
|
||||
|
||||
class Ai1wm_Log {
|
||||
|
||||
public static function error( $params ) {
|
||||
$data = array();
|
||||
|
||||
// Add date
|
||||
$data[] = date( 'M d Y H:i:s' );
|
||||
|
||||
// Add params
|
||||
$data[] = json_encode( $params );
|
||||
|
||||
// Add empty line
|
||||
$data[] = PHP_EOL;
|
||||
|
||||
// Write log data
|
||||
if ( $handle = ai1wm_open( ai1wm_error_path(), 'a' ) ) {
|
||||
ai1wm_write( $handle, implode( PHP_EOL, $data ) );
|
||||
ai1wm_close( $handle );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2014-2020 ServMask Inc.
|
||||
*
|
||||
* 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/>.
|
||||
*
|
||||
* ███████╗███████╗██████╗ ██╗ ██╗███╗ ███╗ █████╗ ███████╗██╗ ██╗
|
||||
* ██╔════╝██╔════╝██╔══██╗██║ ██║████╗ ████║██╔══██╗██╔════╝██║ ██╔╝
|
||||
* ███████╗█████╗ ██████╔╝██║ ██║██╔████╔██║███████║███████╗█████╔╝
|
||||
* ╚════██║██╔══╝ ██╔══██╗╚██╗ ██╔╝██║╚██╔╝██║██╔══██║╚════██║██╔═██╗
|
||||
* ███████║███████╗██║ ██║ ╚████╔╝ ██║ ╚═╝ ██║██║ ██║███████║██║ ██╗
|
||||
* ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
die( 'Kangaroos cannot jump here' );
|
||||
}
|
||||
|
||||
class Ai1wm_Message {
|
||||
|
||||
public static function flash( $type, $message ) {
|
||||
if ( ( $messages = get_option( AI1WM_MESSAGES, array() ) ) !== false ) {
|
||||
return update_option( AI1WM_MESSAGES, array_merge( $messages, array( $type => $message ) ) );
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public static function has( $type ) {
|
||||
if ( ( $messages = get_option( AI1WM_MESSAGES, array() ) ) ) {
|
||||
if ( isset( $messages[ $type ] ) ) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public static function get( $type ) {
|
||||
$message = null;
|
||||
if ( ( $messages = get_option( AI1WM_MESSAGES, array() ) ) ) {
|
||||
if ( isset( $messages[ $type ] ) && ( $message = $messages[ $type ] ) ) {
|
||||
unset( $messages[ $type ] );
|
||||
}
|
||||
|
||||
// Set messages
|
||||
update_option( AI1WM_MESSAGES, $messages );
|
||||
}
|
||||
|
||||
return $message;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2014-2020 ServMask Inc.
|
||||
*
|
||||
* 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/>.
|
||||
*
|
||||
* ███████╗███████╗██████╗ ██╗ ██╗███╗ ███╗ █████╗ ███████╗██╗ ██╗
|
||||
* ██╔════╝██╔════╝██╔══██╗██║ ██║████╗ ████║██╔══██╗██╔════╝██║ ██╔╝
|
||||
* ███████╗█████╗ ██████╔╝██║ ██║██╔████╔██║███████║███████╗█████╔╝
|
||||
* ╚════██║██╔══╝ ██╔══██╗╚██╗ ██╔╝██║╚██╔╝██║██╔══██║╚════██║██╔═██╗
|
||||
* ███████║███████╗██║ ██║ ╚████╔╝ ██║ ╚═╝ ██║██║ ██║███████║██║ ██╗
|
||||
* ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
die( 'Kangaroos cannot jump here' );
|
||||
}
|
||||
|
||||
class Ai1wm_Notification {
|
||||
|
||||
public static function ok( $subject, $message ) {
|
||||
// Enable notifications
|
||||
if ( ! apply_filters( 'ai1wm_notification_ok_toggle', false ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Set email
|
||||
if ( ! ( $email = apply_filters( 'ai1wm_notification_ok_email', get_option( 'admin_email', false ) ) ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Set subject
|
||||
if ( ! ( $subject = apply_filters( 'ai1wm_notification_ok_subject', $subject ) ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Set message
|
||||
if ( ! ( $message = apply_filters( 'ai1wm_notification_ok_message', $message ) ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Send email
|
||||
if ( ai1wm_is_scheduled_backup() ) {
|
||||
wp_mail( $email, $subject, $message, array( 'Content-Type: text/html; charset=UTF-8' ) );
|
||||
}
|
||||
}
|
||||
|
||||
public static function error( $subject, $message ) {
|
||||
// Enable notifications
|
||||
if ( ! apply_filters( 'ai1wm_notification_error_toggle', false ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Set email
|
||||
if ( ! ( $email = apply_filters( 'ai1wm_notification_error_email', get_option( 'admin_email', false ) ) ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Set subject
|
||||
if ( ! ( $subject = apply_filters( 'ai1wm_notification_error_subject', $subject ) ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Set message
|
||||
if ( ! ( $message = apply_filters( 'ai1wm_notification_error_message', $message ) ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Send email
|
||||
if ( ai1wm_is_scheduled_backup() ) {
|
||||
wp_mail( $email, $subject, $message, array( 'Content-Type: text/html; charset=UTF-8' ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2014-2020 ServMask Inc.
|
||||
*
|
||||
* 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/>.
|
||||
*
|
||||
* ███████╗███████╗██████╗ ██╗ ██╗███╗ ███╗ █████╗ ███████╗██╗ ██╗
|
||||
* ██╔════╝██╔════╝██╔══██╗██║ ██║████╗ ████║██╔══██╗██╔════╝██║ ██╔╝
|
||||
* ███████╗█████╗ ██████╔╝██║ ██║██╔████╔██║███████║███████╗█████╔╝
|
||||
* ╚════██║██╔══╝ ██╔══██╗╚██╗ ██╔╝██║╚██╔╝██║██╔══██║╚════██║██╔═██╗
|
||||
* ███████║███████╗██║ ██║ ╚████╔╝ ██║ ╚═╝ ██║██║ ██║███████║██║ ██╗
|
||||
* ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
die( 'Kangaroos cannot jump here' );
|
||||
}
|
||||
|
||||
class Ai1wm_Status {
|
||||
|
||||
public static function error( $title, $message ) {
|
||||
self::log( array( 'type' => 'error', 'title' => $title, 'message' => $message ) );
|
||||
}
|
||||
|
||||
public static function info( $message ) {
|
||||
self::log( array( 'type' => 'info', 'message' => $message ) );
|
||||
}
|
||||
|
||||
public static function download( $message ) {
|
||||
self::log( array( 'type' => 'download', 'message' => $message ) );
|
||||
}
|
||||
|
||||
public static function disk_space_confirm( $message ) {
|
||||
self::log( array( 'type' => 'disk_space_confirm', 'message' => $message ) );
|
||||
}
|
||||
|
||||
public static function confirm( $message ) {
|
||||
self::log( array( 'type' => 'confirm', 'message' => $message ) );
|
||||
}
|
||||
|
||||
public static function done( $title, $message ) {
|
||||
self::log( array( 'type' => 'done', 'title' => $title, 'message' => $message ) );
|
||||
}
|
||||
|
||||
public static function blogs( $title, $message ) {
|
||||
self::log( array( 'type' => 'blogs', 'title' => $title, 'message' => $message ) );
|
||||
}
|
||||
|
||||
public static function progress( $percent ) {
|
||||
self::log( array( 'type' => 'progress', 'percent' => $percent ) );
|
||||
}
|
||||
|
||||
public static function log( $data ) {
|
||||
if ( ! ai1wm_is_scheduled_backup() ) {
|
||||
update_option( AI1WM_STATUS, $data );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2014-2020 ServMask Inc.
|
||||
*
|
||||
* 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/>.
|
||||
*
|
||||
* ███████╗███████╗██████╗ ██╗ ██╗███╗ ███╗ █████╗ ███████╗██╗ ██╗
|
||||
* ██╔════╝██╔════╝██╔══██╗██║ ██║████╗ ████║██╔══██╗██╔════╝██║ ██╔╝
|
||||
* ███████╗█████╗ ██████╔╝██║ ██║██╔████╔██║███████║███████╗█████╔╝
|
||||
* ╚════██║██╔══╝ ██╔══██╗╚██╗ ██╔╝██║╚██╔╝██║██╔══██║╚════██║██╔═██╗
|
||||
* ███████║███████╗██║ ██║ ╚████╔╝ ██║ ╚═╝ ██║██║ ██║███████║██║ ██╗
|
||||
* ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
die( 'Kangaroos cannot jump here' );
|
||||
}
|
||||
|
||||
class Ai1wm_Template extends Bandar {
|
||||
|
||||
/**
|
||||
* Renders a file and returns its contents
|
||||
*
|
||||
* @param string $view View to render
|
||||
* @param array $args Set of arguments
|
||||
* @param string|bool $path Path to template
|
||||
* @return string Rendered view
|
||||
*/
|
||||
public static function render( $view, $args = array(), $path = false ) {
|
||||
parent::render( $view, $args, $path );
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns link to an asset file
|
||||
*
|
||||
* @param string $asset Asset file
|
||||
* @param string $prefix Asset prefix
|
||||
* @return string Asset URL
|
||||
*/
|
||||
public static function asset_link( $asset, $prefix = 'AI1WM' ) {
|
||||
return constant( $prefix . '_URL' ) . '/lib/view/assets/' . $asset . '?v=' . constant( $prefix . '_VERSION' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Renders a file and gets its contents
|
||||
*
|
||||
* @param string $view View to render
|
||||
* @param array $args Set of arguments
|
||||
* @param string|bool $path Path to template
|
||||
* @return string Rendered view
|
||||
*/
|
||||
public static function get_content( $view, $args = array(), $path = false ) {
|
||||
return parent::getTemplateContent( $view, $args, $path );
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,214 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2014-2020 ServMask Inc.
|
||||
*
|
||||
* 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/>.
|
||||
*
|
||||
* ███████╗███████╗██████╗ ██╗ ██╗███╗ ███╗ █████╗ ███████╗██╗ ██╗
|
||||
* ██╔════╝██╔════╝██╔══██╗██║ ██║████╗ ████║██╔══██╗██╔════╝██║ ██╔╝
|
||||
* ███████╗█████╗ ██████╔╝██║ ██║██╔████╔██║███████║███████╗█████╔╝
|
||||
* ╚════██║██╔══╝ ██╔══██╗╚██╗ ██╔╝██║╚██╔╝██║██╔══██║╚════██║██╔═██╗
|
||||
* ███████║███████╗██║ ██║ ╚████╔╝ ██║ ╚═╝ ██║██║ ██║███████║██║ ██╗
|
||||
* ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
die( 'Kangaroos cannot jump here' );
|
||||
}
|
||||
|
||||
class Ai1wm_Updater {
|
||||
|
||||
/**
|
||||
* Retrieve plugin installer pages from WordPress Plugins API.
|
||||
*
|
||||
* @param mixed $result
|
||||
* @param string $action
|
||||
* @param array|object $args
|
||||
* @return mixed
|
||||
*/
|
||||
public static function plugins_api( $result, $action = null, $args = null ) {
|
||||
if ( empty( $args->slug ) ) {
|
||||
return $result;
|
||||
}
|
||||
|
||||
// Get extensions
|
||||
$extensions = Ai1wm_Extensions::get();
|
||||
|
||||
// View details page
|
||||
if ( isset( $extensions[ $args->slug ] ) && $action === 'plugin_information' ) {
|
||||
$updater = get_option( AI1WM_UPDATER, array() );
|
||||
|
||||
// Plugin details
|
||||
if ( isset( $updater[ $args->slug ] ) ) {
|
||||
return (object) $updater[ $args->slug ];
|
||||
}
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Update WordPress plugin list page.
|
||||
*
|
||||
* @param object $transient
|
||||
* @return object
|
||||
*/
|
||||
public static function update_plugins( $transient ) {
|
||||
global $wp_version;
|
||||
|
||||
// Creating default object from empty value
|
||||
if ( ! is_object( $transient ) ) {
|
||||
$transient = (object) array();
|
||||
}
|
||||
|
||||
// Get extensions
|
||||
$extensions = Ai1wm_Extensions::get();
|
||||
|
||||
// Get current updates
|
||||
$updater = get_option( AI1WM_UPDATER, array() );
|
||||
|
||||
// Get extension updates
|
||||
foreach ( $updater as $slug => $update ) {
|
||||
if ( isset( $extensions[ $slug ], $update['version'], $update['homepage'], $update['download_link'], $update['icons'] ) ) {
|
||||
if ( ( $purchase_id = get_option( $extensions[ $slug ]['key'] ) ) ) {
|
||||
|
||||
// Get download URL
|
||||
if ( $slug === 'all-in-one-wp-migration-file-extension' ) {
|
||||
$download_url = add_query_arg( array( 'siteurl' => get_site_url() ), sprintf( '%s', $update['download_link'] ) );
|
||||
} else {
|
||||
$download_url = add_query_arg( array( 'siteurl' => get_site_url() ), sprintf( '%s/%s', $update['download_link'], $purchase_id ) );
|
||||
}
|
||||
|
||||
// Set plugin details
|
||||
$plugin_details = (object) array(
|
||||
'slug' => $slug,
|
||||
'new_version' => $update['version'],
|
||||
'url' => $update['homepage'],
|
||||
'plugin' => $extensions[ $slug ]['basename'],
|
||||
'package' => $download_url,
|
||||
'tested' => $wp_version,
|
||||
'icons' => $update['icons'],
|
||||
);
|
||||
|
||||
// Enable auto updates
|
||||
if ( version_compare( $extensions[ $slug ]['version'], $update['version'], '<' ) ) {
|
||||
$transient->response[ $extensions[ $slug ]['basename'] ] = $plugin_details;
|
||||
} else {
|
||||
$transient->no_update[ $extensions[ $slug ]['basename'] ] = $plugin_details;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $transient;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check for extension updates
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public static function check_for_updates() {
|
||||
$updater = get_option( AI1WM_UPDATER, array() );
|
||||
|
||||
// Get extension updates
|
||||
foreach ( Ai1wm_Extensions::get() as $slug => $extension ) {
|
||||
$about = wp_remote_get(
|
||||
$extension['about'],
|
||||
array(
|
||||
'timeout' => 15,
|
||||
'headers' => array( 'Accept' => 'application/json' ),
|
||||
)
|
||||
);
|
||||
|
||||
// Add plugin updates
|
||||
if ( is_wp_error( $about ) ) {
|
||||
$updater[ $slug ]['error_message'] = $about->get_error_message();
|
||||
} else {
|
||||
$body = wp_remote_retrieve_body( $about );
|
||||
if ( ( $data = json_decode( $body, true ) ) ) {
|
||||
if ( isset( $data['slug'], $data['version'], $data['homepage'], $data['download_link'], $data['icons'] ) ) {
|
||||
$updater[ $slug ] = $data;
|
||||
}
|
||||
}
|
||||
|
||||
// Add plugin messages
|
||||
if ( $slug !== 'all-in-one-wp-migration-file-extension' ) {
|
||||
if ( ( $purchase_id = get_option( $extension['key'] ) ) ) {
|
||||
$check = wp_remote_get(
|
||||
add_query_arg( array( 'site_url' => get_site_url(), 'admin_email' => get_option( 'admin_email' ) ), sprintf( '%s/%s', $extension['check'], $purchase_id ) ),
|
||||
array(
|
||||
'timeout' => 15,
|
||||
'headers' => array( 'Accept' => 'application/json' ),
|
||||
)
|
||||
);
|
||||
|
||||
// Add plugin checks
|
||||
if ( is_wp_error( $check ) ) {
|
||||
$updater[ $slug ]['error_message'] = $check->get_error_message();
|
||||
} else {
|
||||
$body = wp_remote_retrieve_body( $check );
|
||||
if ( ( $data = json_decode( $body, true ) ) ) {
|
||||
if ( isset( $updater[ $slug ], $data['message'] ) ) {
|
||||
$updater[ $slug ]['update_message'] = $data['message'];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return update_option( AI1WM_UPDATER, $updater );
|
||||
}
|
||||
|
||||
/**
|
||||
* Add "Check for updates" link
|
||||
*
|
||||
* @param array $plugin_meta An array of the plugin's metadata, including the version, author, author URI, and plugin URI
|
||||
* @param string $plugin_file Path to the plugin file relative to the plugins directory
|
||||
* @return array
|
||||
*/
|
||||
public static function plugin_row_meta( $plugin_meta, $plugin_file ) {
|
||||
$modal_index = 0;
|
||||
|
||||
// Get current updates
|
||||
$updater = get_option( AI1WM_UPDATER, array() );
|
||||
|
||||
// Add link for each extension
|
||||
foreach ( Ai1wm_Extensions::get() as $slug => $extension ) {
|
||||
$modal_index++;
|
||||
|
||||
// Get plugin details
|
||||
if ( $plugin_file === $extension['basename'] ) {
|
||||
|
||||
// Get updater URL
|
||||
$updater_url = add_query_arg( array( 'ai1wm_check_for_updates' => 1, 'ai1wm_nonce' => wp_create_nonce( 'ai1wm_check_for_updates' ) ), network_admin_url( 'plugins.php' ) );
|
||||
|
||||
// Check purchase ID
|
||||
if ( get_option( $extension['key'] ) ) {
|
||||
$plugin_meta[] = Ai1wm_Template::get_content( 'updater/check', array( 'url' => $updater_url ) );
|
||||
} else {
|
||||
$plugin_meta[] = Ai1wm_Template::get_content( 'updater/modal', array( 'url' => $updater_url, 'modal' => $modal_index ) );
|
||||
}
|
||||
// Check error message
|
||||
if ( isset( $updater[ $slug ]['error_message'] ) ) {
|
||||
$plugin_meta[] = Ai1wm_Template::get_content( 'updater/error', array( 'message' => $updater[ $slug ]['error_message'] ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $plugin_meta;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2014-2020 ServMask Inc.
|
||||
*
|
||||
* 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/>.
|
||||
*
|
||||
* ███████╗███████╗██████╗ ██╗ ██╗███╗ ███╗ █████╗ ███████╗██╗ ██╗
|
||||
* ██╔════╝██╔════╝██╔══██╗██║ ██║████╗ ████║██╔══██╗██╔════╝██║ ██╔╝
|
||||
* ███████╗█████╗ ██████╔╝██║ ██║██╔████╔██║███████║███████╗█████╔╝
|
||||
* ╚════██║██╔══╝ ██╔══██╗╚██╗ ██╔╝██║╚██╔╝██║██╔══██║╚════██║██╔═██╗
|
||||
* ███████║███████╗██║ ██║ ╚████╔╝ ██║ ╚═╝ ██║██║ ██║███████║██║ ██╗
|
||||
* ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
die( 'Kangaroos cannot jump here' );
|
||||
}
|
||||
|
||||
class Ai1wm_Export_Archive {
|
||||
|
||||
public static function execute( $params ) {
|
||||
|
||||
// Set progress
|
||||
Ai1wm_Status::info( __( 'Creating an empty archive...', AI1WM_PLUGIN_NAME ) );
|
||||
|
||||
// Create empty archive file
|
||||
$archive = new Ai1wm_Compressor( ai1wm_archive_path( $params ) );
|
||||
$archive->close();
|
||||
|
||||
// Set progress
|
||||
Ai1wm_Status::info( __( 'Done creating an empty archive.', AI1WM_PLUGIN_NAME ) );
|
||||
|
||||
return $params;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2014-2020 ServMask Inc.
|
||||
*
|
||||
* 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/>.
|
||||
*
|
||||
* ███████╗███████╗██████╗ ██╗ ██╗███╗ ███╗ █████╗ ███████╗██╗ ██╗
|
||||
* ██╔════╝██╔════╝██╔══██╗██║ ██║████╗ ████║██╔══██╗██╔════╝██║ ██╔╝
|
||||
* ███████╗█████╗ ██████╔╝██║ ██║██╔████╔██║███████║███████╗█████╔╝
|
||||
* ╚════██║██╔══╝ ██╔══██╗╚██╗ ██╔╝██║╚██╔╝██║██╔══██║╚════██║██╔═██╗
|
||||
* ███████║███████╗██║ ██║ ╚████╔╝ ██║ ╚═╝ ██║██║ ██║███████║██║ ██╗
|
||||
* ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
die( 'Kangaroos cannot jump here' );
|
||||
}
|
||||
|
||||
class Ai1wm_Export_Clean {
|
||||
|
||||
public static function execute( $params ) {
|
||||
|
||||
// Delete storage files
|
||||
Ai1wm_Directory::delete( ai1wm_storage_path( $params ) );
|
||||
|
||||
// Exit in console
|
||||
if ( defined( 'WP_CLI' ) ) {
|
||||
return $params;
|
||||
}
|
||||
|
||||
exit;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2014-2020 ServMask Inc.
|
||||
*
|
||||
* 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/>.
|
||||
*
|
||||
* ███████╗███████╗██████╗ ██╗ ██╗███╗ ███╗ █████╗ ███████╗██╗ ██╗
|
||||
* ██╔════╝██╔════╝██╔══██╗██║ ██║████╗ ████║██╔══██╗██╔════╝██║ ██╔╝
|
||||
* ███████╗█████╗ ██████╔╝██║ ██║██╔████╔██║███████║███████╗█████╔╝
|
||||
* ╚════██║██╔══╝ ██╔══██╗╚██╗ ██╔╝██║╚██╔╝██║██╔══██║╚════██║██╔═██╗
|
||||
* ███████║███████╗██║ ██║ ╚████╔╝ ██║ ╚═╝ ██║██║ ██║███████║██║ ██╗
|
||||
* ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
die( 'Kangaroos cannot jump here' );
|
||||
}
|
||||
|
||||
class Ai1wm_Export_Compatibility {
|
||||
|
||||
public static function execute( $params ) {
|
||||
|
||||
// Set progress
|
||||
Ai1wm_Status::info( __( 'Checking extensions compatibility...', AI1WM_PLUGIN_NAME ) );
|
||||
|
||||
// Get messages
|
||||
$messages = Ai1wm_Compatibility::get( $params );
|
||||
|
||||
// Set messages
|
||||
if ( empty( $messages ) ) {
|
||||
return $params;
|
||||
}
|
||||
|
||||
// Error message
|
||||
throw new Ai1wm_Compatibility_Exception( implode( $messages ) );
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,119 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2014-2020 ServMask Inc.
|
||||
*
|
||||
* 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/>.
|
||||
*
|
||||
* ███████╗███████╗██████╗ ██╗ ██╗███╗ ███╗ █████╗ ███████╗██╗ ██╗
|
||||
* ██╔════╝██╔════╝██╔══██╗██║ ██║████╗ ████║██╔══██╗██╔════╝██║ ██╔╝
|
||||
* ███████╗█████╗ ██████╔╝██║ ██║██╔████╔██║███████║███████╗█████╔╝
|
||||
* ╚════██║██╔══╝ ██╔══██╗╚██╗ ██╔╝██║╚██╔╝██║██╔══██║╚════██║██╔═██╗
|
||||
* ███████║███████╗██║ ██║ ╚████╔╝ ██║ ╚═╝ ██║██║ ██║███████║██║ ██╗
|
||||
* ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
die( 'Kangaroos cannot jump here' );
|
||||
}
|
||||
|
||||
class Ai1wm_Export_Config_File {
|
||||
|
||||
public static function execute( $params ) {
|
||||
|
||||
$package_bytes_written = 0;
|
||||
|
||||
// Set archive bytes offset
|
||||
if ( isset( $params['archive_bytes_offset'] ) ) {
|
||||
$archive_bytes_offset = (int) $params['archive_bytes_offset'];
|
||||
} else {
|
||||
$archive_bytes_offset = ai1wm_archive_bytes( $params );
|
||||
}
|
||||
|
||||
// Set package bytes offset
|
||||
if ( isset( $params['package_bytes_offset'] ) ) {
|
||||
$package_bytes_offset = (int) $params['package_bytes_offset'];
|
||||
} else {
|
||||
$package_bytes_offset = 0;
|
||||
}
|
||||
|
||||
// Get total package size
|
||||
if ( isset( $params['total_package_size'] ) ) {
|
||||
$total_package_size = (int) $params['total_package_size'];
|
||||
} else {
|
||||
$total_package_size = ai1wm_package_bytes( $params );
|
||||
}
|
||||
|
||||
// What percent of package have we processed?
|
||||
$progress = (int) min( ( $package_bytes_offset / $total_package_size ) * 100, 100 );
|
||||
|
||||
// Set progress
|
||||
Ai1wm_Status::info( sprintf( __( 'Archiving configuration file...<br />%d%% complete', AI1WM_PLUGIN_NAME ), $progress ) );
|
||||
|
||||
// Open the archive file for writing
|
||||
$archive = new Ai1wm_Compressor( ai1wm_archive_path( $params ) );
|
||||
|
||||
// Set the file pointer to the one that we have saved
|
||||
$archive->set_file_pointer( $archive_bytes_offset );
|
||||
|
||||
// Add package.json to archive
|
||||
if ( $archive->add_file( ai1wm_package_path( $params ), AI1WM_PACKAGE_NAME, $package_bytes_written, $package_bytes_offset ) ) {
|
||||
|
||||
// Set progress
|
||||
Ai1wm_Status::info( __( 'Done archiving configuration file.', AI1WM_PLUGIN_NAME ) );
|
||||
|
||||
// Unset archive bytes offset
|
||||
unset( $params['archive_bytes_offset'] );
|
||||
|
||||
// Unset package bytes offset
|
||||
unset( $params['package_bytes_offset'] );
|
||||
|
||||
// Unset total package size
|
||||
unset( $params['total_package_size'] );
|
||||
|
||||
// Unset completed flag
|
||||
unset( $params['completed'] );
|
||||
|
||||
} else {
|
||||
|
||||
// Get archive bytes offset
|
||||
$archive_bytes_offset = $archive->get_file_pointer();
|
||||
|
||||
// What percent of package have we processed?
|
||||
$progress = (int) min( ( $package_bytes_offset / $total_package_size ) * 100, 100 );
|
||||
|
||||
// Set progress
|
||||
Ai1wm_Status::info( sprintf( __( 'Archiving configuration file...<br />%d%% complete', AI1WM_PLUGIN_NAME ), $progress ) );
|
||||
|
||||
// Set archive bytes offset
|
||||
$params['archive_bytes_offset'] = $archive_bytes_offset;
|
||||
|
||||
// Set package bytes offset
|
||||
$params['package_bytes_offset'] = $package_bytes_offset;
|
||||
|
||||
// Set total package size
|
||||
$params['total_package_size'] = $total_package_size;
|
||||
|
||||
// Set completed flag
|
||||
$params['completed'] = false;
|
||||
}
|
||||
|
||||
// Truncate the archive file
|
||||
$archive->truncate();
|
||||
|
||||
// Close the archive file
|
||||
$archive->close();
|
||||
|
||||
return $params;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,171 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2014-2020 ServMask Inc.
|
||||
*
|
||||
* 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/>.
|
||||
*
|
||||
* ███████╗███████╗██████╗ ██╗ ██╗███╗ ███╗ █████╗ ███████╗██╗ ██╗
|
||||
* ██╔════╝██╔════╝██╔══██╗██║ ██║████╗ ████║██╔══██╗██╔════╝██║ ██╔╝
|
||||
* ███████╗█████╗ ██████╔╝██║ ██║██╔████╔██║███████║███████╗█████╔╝
|
||||
* ╚════██║██╔══╝ ██╔══██╗╚██╗ ██╔╝██║╚██╔╝██║██╔══██║╚════██║██╔═██╗
|
||||
* ███████║███████╗██║ ██║ ╚████╔╝ ██║ ╚═╝ ██║██║ ██║███████║██║ ██╗
|
||||
* ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
die( 'Kangaroos cannot jump here' );
|
||||
}
|
||||
|
||||
class Ai1wm_Export_Config {
|
||||
|
||||
public static function execute( $params ) {
|
||||
global $table_prefix, $wp_version, $wpdb;
|
||||
|
||||
// Set progress
|
||||
Ai1wm_Status::info( __( 'Preparing configuration file...', AI1WM_PLUGIN_NAME ) );
|
||||
|
||||
// Get options
|
||||
$options = wp_load_alloptions();
|
||||
|
||||
// Get database client
|
||||
if ( empty( $wpdb->use_mysqli ) ) {
|
||||
$mysql = new Ai1wm_Database_Mysql( $wpdb );
|
||||
} else {
|
||||
$mysql = new Ai1wm_Database_Mysqli( $wpdb );
|
||||
}
|
||||
|
||||
$config = array();
|
||||
|
||||
// Set site URL
|
||||
$config['SiteURL'] = site_url();
|
||||
|
||||
// Set home URL
|
||||
$config['HomeURL'] = home_url();
|
||||
|
||||
// Set internal site URL
|
||||
if ( isset( $options['siteurl'] ) ) {
|
||||
$config['InternalSiteURL'] = $options['siteurl'];
|
||||
}
|
||||
|
||||
// Set internal home URL
|
||||
if ( isset( $options['home'] ) ) {
|
||||
$config['InternalHomeURL'] = $options['home'];
|
||||
}
|
||||
|
||||
// Set replace old and new values
|
||||
if ( isset( $params['options']['replace'] ) && ( $replace = $params['options']['replace'] ) ) {
|
||||
for ( $i = 0; $i < count( $replace['old_value'] ); $i++ ) {
|
||||
if ( ! empty( $replace['old_value'][ $i ] ) && ! empty( $replace['new_value'][ $i ] ) ) {
|
||||
$config['Replace']['OldValues'][] = $replace['old_value'][ $i ];
|
||||
$config['Replace']['NewValues'][] = $replace['new_value'][ $i ];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Set no spam comments
|
||||
if ( isset( $params['options']['no_spam_comments'] ) ) {
|
||||
$config['NoSpamComments'] = true;
|
||||
}
|
||||
|
||||
// Set no post revisions
|
||||
if ( isset( $params['options']['no_post_revisions'] ) ) {
|
||||
$config['NoPostRevisions'] = true;
|
||||
}
|
||||
|
||||
// Set no media
|
||||
if ( isset( $params['options']['no_media'] ) ) {
|
||||
$config['NoMedia'] = true;
|
||||
}
|
||||
|
||||
// Set no themes
|
||||
if ( isset( $params['options']['no_themes'] ) ) {
|
||||
$config['NoThemes'] = true;
|
||||
}
|
||||
|
||||
// Set no inactive themes
|
||||
if ( isset( $params['options']['no_inactive_themes'] ) ) {
|
||||
$config['NoInactiveThemes'] = true;
|
||||
}
|
||||
|
||||
// Set no must-use plugins
|
||||
if ( isset( $params['options']['no_muplugins'] ) ) {
|
||||
$config['NoMustUsePlugins'] = true;
|
||||
}
|
||||
|
||||
// Set no plugins
|
||||
if ( isset( $params['options']['no_plugins'] ) ) {
|
||||
$config['NoPlugins'] = true;
|
||||
}
|
||||
|
||||
// Set no inactive plugins
|
||||
if ( isset( $params['options']['no_inactive_plugins'] ) ) {
|
||||
$config['NoInactivePlugins'] = true;
|
||||
}
|
||||
|
||||
// Set no cache
|
||||
if ( isset( $params['options']['no_cache'] ) ) {
|
||||
$config['NoCache'] = true;
|
||||
}
|
||||
|
||||
// Set no database
|
||||
if ( isset( $params['options']['no_database'] ) ) {
|
||||
$config['NoDatabase'] = true;
|
||||
}
|
||||
|
||||
// Set no email replace
|
||||
if ( isset( $params['options']['no_email_replace'] ) ) {
|
||||
$config['NoEmailReplace'] = true;
|
||||
}
|
||||
|
||||
// Set plugin version
|
||||
$config['Plugin'] = array( 'Version' => AI1WM_VERSION );
|
||||
|
||||
// Set WordPress version and content
|
||||
$config['WordPress'] = array( 'Version' => $wp_version, 'Content' => WP_CONTENT_DIR, 'Plugins' => ai1wm_get_plugins_dir(), 'Themes' => ai1wm_get_themes_dirs(), 'Uploads' => ai1wm_get_uploads_dir(), 'UploadsURL' => ai1wm_get_uploads_url() );
|
||||
|
||||
// Set database version
|
||||
$config['Database'] = array( 'Version' => $mysql->version(), 'Charset' => DB_CHARSET, 'Collate' => DB_COLLATE, 'Prefix' => $table_prefix );
|
||||
|
||||
// Set PHP version
|
||||
$config['PHP'] = array( 'Version' => PHP_VERSION, 'System' => PHP_OS, 'Integer' => PHP_INT_SIZE );
|
||||
|
||||
// Set active plugins
|
||||
$config['Plugins'] = array_values( array_diff( ai1wm_active_plugins(), ai1wm_active_servmask_plugins() ) );
|
||||
|
||||
// Set active template
|
||||
$config['Template'] = ai1wm_active_template();
|
||||
|
||||
// Set active stylesheet
|
||||
$config['Stylesheet'] = ai1wm_active_stylesheet();
|
||||
|
||||
// Set upload path
|
||||
$config['Uploads'] = get_option( 'upload_path' );
|
||||
|
||||
// Set upload URL path
|
||||
$config['UploadsURL'] = get_option( 'upload_url_path' );
|
||||
|
||||
// Set server info
|
||||
$config['Server'] = array( '.htaccess' => base64_encode( ai1wm_get_htaccess() ), 'web.config' => base64_encode( ai1wm_get_webconfig() ) );
|
||||
|
||||
// Save package.json file
|
||||
$handle = ai1wm_open( ai1wm_package_path( $params ), 'w' );
|
||||
ai1wm_write( $handle, json_encode( $config ) );
|
||||
ai1wm_close( $handle );
|
||||
|
||||
// Set progress
|
||||
Ai1wm_Status::info( __( 'Done preparing configuration file.', AI1WM_PLUGIN_NAME ) );
|
||||
|
||||
return $params;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,193 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2014-2020 ServMask Inc.
|
||||
*
|
||||
* 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/>.
|
||||
*
|
||||
* ███████╗███████╗██████╗ ██╗ ██╗███╗ ███╗ █████╗ ███████╗██╗ ██╗
|
||||
* ██╔════╝██╔════╝██╔══██╗██║ ██║████╗ ████║██╔══██╗██╔════╝██║ ██╔╝
|
||||
* ███████╗█████╗ ██████╔╝██║ ██║██╔████╔██║███████║███████╗█████╔╝
|
||||
* ╚════██║██╔══╝ ██╔══██╗╚██╗ ██╔╝██║╚██╔╝██║██╔══██║╚════██║██╔═██╗
|
||||
* ███████║███████╗██║ ██║ ╚████╔╝ ██║ ╚═╝ ██║██║ ██║███████║██║ ██╗
|
||||
* ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
die( 'Kangaroos cannot jump here' );
|
||||
}
|
||||
|
||||
class Ai1wm_Export_Content {
|
||||
|
||||
public static function execute( $params ) {
|
||||
|
||||
// Set archive bytes offset
|
||||
if ( isset( $params['archive_bytes_offset'] ) ) {
|
||||
$archive_bytes_offset = (int) $params['archive_bytes_offset'];
|
||||
} else {
|
||||
$archive_bytes_offset = ai1wm_archive_bytes( $params );
|
||||
}
|
||||
|
||||
// Set file bytes offset
|
||||
if ( isset( $params['file_bytes_offset'] ) ) {
|
||||
$file_bytes_offset = (int) $params['file_bytes_offset'];
|
||||
} else {
|
||||
$file_bytes_offset = 0;
|
||||
}
|
||||
|
||||
// Set content bytes offset
|
||||
if ( isset( $params['content_bytes_offset'] ) ) {
|
||||
$content_bytes_offset = (int) $params['content_bytes_offset'];
|
||||
} else {
|
||||
$content_bytes_offset = 0;
|
||||
}
|
||||
|
||||
// Get processed files size
|
||||
if ( isset( $params['processed_files_size'] ) ) {
|
||||
$processed_files_size = (int) $params['processed_files_size'];
|
||||
} else {
|
||||
$processed_files_size = 0;
|
||||
}
|
||||
|
||||
// Get total content files size
|
||||
if ( isset( $params['total_content_files_size'] ) ) {
|
||||
$total_content_files_size = (int) $params['total_content_files_size'];
|
||||
} else {
|
||||
$total_content_files_size = 1;
|
||||
}
|
||||
|
||||
// Get total content files count
|
||||
if ( isset( $params['total_content_files_count'] ) ) {
|
||||
$total_content_files_count = (int) $params['total_content_files_count'];
|
||||
} else {
|
||||
$total_content_files_count = 1;
|
||||
}
|
||||
|
||||
// What percent of files have we processed?
|
||||
$progress = (int) min( ( $processed_files_size / $total_content_files_size ) * 100, 100 );
|
||||
|
||||
// Set progress
|
||||
Ai1wm_Status::info( sprintf( __( 'Archiving %d content files...<br />%d%% complete', AI1WM_PLUGIN_NAME ), $total_content_files_count, $progress ) );
|
||||
|
||||
// Flag to hold if file data has been processed
|
||||
$completed = true;
|
||||
|
||||
// Start time
|
||||
$start = microtime( true );
|
||||
|
||||
// Get content list file
|
||||
$content_list = ai1wm_open( ai1wm_content_list_path( $params ), 'r' );
|
||||
|
||||
// Set the file pointer at the current index
|
||||
if ( fseek( $content_list, $content_bytes_offset ) !== -1 ) {
|
||||
|
||||
// Open the archive file for writing
|
||||
$archive = new Ai1wm_Compressor( ai1wm_archive_path( $params ) );
|
||||
|
||||
// Set the file pointer to the one that we have saved
|
||||
$archive->set_file_pointer( $archive_bytes_offset );
|
||||
|
||||
// Loop over files
|
||||
while ( list( $file_abspath, $file_relpath, $file_size, $file_mtime ) = fgetcsv( $content_list ) ) {
|
||||
$file_bytes_written = 0;
|
||||
|
||||
// Add file to archive
|
||||
if ( ( $completed = $archive->add_file( $file_abspath, $file_relpath, $file_bytes_written, $file_bytes_offset ) ) ) {
|
||||
$file_bytes_offset = 0;
|
||||
|
||||
// Get content bytes offset
|
||||
$content_bytes_offset = ftell( $content_list );
|
||||
}
|
||||
|
||||
// Increment processed files size
|
||||
$processed_files_size += $file_bytes_written;
|
||||
|
||||
// What percent of files have we processed?
|
||||
$progress = (int) min( ( $processed_files_size / $total_content_files_size ) * 100, 100 );
|
||||
|
||||
// Set progress
|
||||
Ai1wm_Status::info( sprintf( __( 'Archiving %d content files...<br />%d%% complete', AI1WM_PLUGIN_NAME ), $total_content_files_count, $progress ) );
|
||||
|
||||
// More than 10 seconds have passed, break and do another request
|
||||
if ( ( $timeout = apply_filters( 'ai1wm_completed_timeout', 10 ) ) ) {
|
||||
if ( ( microtime( true ) - $start ) > $timeout ) {
|
||||
$completed = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Get archive bytes offset
|
||||
$archive_bytes_offset = $archive->get_file_pointer();
|
||||
|
||||
// Truncate the archive file
|
||||
$archive->truncate();
|
||||
|
||||
// Close the archive file
|
||||
$archive->close();
|
||||
}
|
||||
|
||||
// End of the content list?
|
||||
if ( feof( $content_list ) ) {
|
||||
|
||||
// Unset archive bytes offset
|
||||
unset( $params['archive_bytes_offset'] );
|
||||
|
||||
// Unset file bytes offset
|
||||
unset( $params['file_bytes_offset'] );
|
||||
|
||||
// Unset content bytes offset
|
||||
unset( $params['content_bytes_offset'] );
|
||||
|
||||
// Unset processed files size
|
||||
unset( $params['processed_files_size'] );
|
||||
|
||||
// Unset total content files size
|
||||
unset( $params['total_content_files_size'] );
|
||||
|
||||
// Unset total content files count
|
||||
unset( $params['total_content_files_count'] );
|
||||
|
||||
// Unset completed flag
|
||||
unset( $params['completed'] );
|
||||
|
||||
} else {
|
||||
|
||||
// Set archive bytes offset
|
||||
$params['archive_bytes_offset'] = $archive_bytes_offset;
|
||||
|
||||
// Set file bytes offset
|
||||
$params['file_bytes_offset'] = $file_bytes_offset;
|
||||
|
||||
// Set content bytes offset
|
||||
$params['content_bytes_offset'] = $content_bytes_offset;
|
||||
|
||||
// Set processed files size
|
||||
$params['processed_files_size'] = $processed_files_size;
|
||||
|
||||
// Set total content files size
|
||||
$params['total_content_files_size'] = $total_content_files_size;
|
||||
|
||||
// Set total content files count
|
||||
$params['total_content_files_count'] = $total_content_files_count;
|
||||
|
||||
// Set completed flag
|
||||
$params['completed'] = $completed;
|
||||
}
|
||||
|
||||
// Close the content list file
|
||||
ai1wm_close( $content_list );
|
||||
|
||||
return $params;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,124 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2014-2020 ServMask Inc.
|
||||
*
|
||||
* 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/>.
|
||||
*
|
||||
* ███████╗███████╗██████╗ ██╗ ██╗███╗ ███╗ █████╗ ███████╗██╗ ██╗
|
||||
* ██╔════╝██╔════╝██╔══██╗██║ ██║████╗ ████║██╔══██╗██╔════╝██║ ██╔╝
|
||||
* ███████╗█████╗ ██████╔╝██║ ██║██╔████╔██║███████║███████╗█████╔╝
|
||||
* ╚════██║██╔══╝ ██╔══██╗╚██╗ ██╔╝██║╚██╔╝██║██╔══██║╚════██║██╔═██╗
|
||||
* ███████║███████╗██║ ██║ ╚████╔╝ ██║ ╚═╝ ██║██║ ██║███████║██║ ██╗
|
||||
* ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
die( 'Kangaroos cannot jump here' );
|
||||
}
|
||||
|
||||
class Ai1wm_Export_Database_File {
|
||||
|
||||
public static function execute( $params ) {
|
||||
|
||||
// Set exclude database
|
||||
if ( isset( $params['options']['no_database'] ) ) {
|
||||
return $params;
|
||||
}
|
||||
|
||||
$database_bytes_written = 0;
|
||||
|
||||
// Set archive bytes offset
|
||||
if ( isset( $params['archive_bytes_offset'] ) ) {
|
||||
$archive_bytes_offset = (int) $params['archive_bytes_offset'];
|
||||
} else {
|
||||
$archive_bytes_offset = ai1wm_archive_bytes( $params );
|
||||
}
|
||||
|
||||
// Set database bytes offset
|
||||
if ( isset( $params['database_bytes_offset'] ) ) {
|
||||
$database_bytes_offset = (int) $params['database_bytes_offset'];
|
||||
} else {
|
||||
$database_bytes_offset = 0;
|
||||
}
|
||||
|
||||
// Get total database size
|
||||
if ( isset( $params['total_database_size'] ) ) {
|
||||
$total_database_size = (int) $params['total_database_size'];
|
||||
} else {
|
||||
$total_database_size = ai1wm_database_bytes( $params );
|
||||
}
|
||||
|
||||
// What percent of database have we processed?
|
||||
$progress = (int) min( ( $database_bytes_offset / $total_database_size ) * 100, 100 );
|
||||
|
||||
// Set progress
|
||||
Ai1wm_Status::info( sprintf( __( 'Archiving database...<br />%d%% complete', AI1WM_PLUGIN_NAME ), $progress ) );
|
||||
|
||||
// Open the archive file for writing
|
||||
$archive = new Ai1wm_Compressor( ai1wm_archive_path( $params ) );
|
||||
|
||||
// Set the file pointer to the one that we have saved
|
||||
$archive->set_file_pointer( $archive_bytes_offset );
|
||||
|
||||
// Add database.sql to archive
|
||||
if ( $archive->add_file( ai1wm_database_path( $params ), AI1WM_DATABASE_NAME, $database_bytes_written, $database_bytes_offset ) ) {
|
||||
|
||||
// Set progress
|
||||
Ai1wm_Status::info( __( 'Done archiving database.', AI1WM_PLUGIN_NAME ) );
|
||||
|
||||
// Unset archive bytes offset
|
||||
unset( $params['archive_bytes_offset'] );
|
||||
|
||||
// Unset database bytes offset
|
||||
unset( $params['database_bytes_offset'] );
|
||||
|
||||
// Unset total database size
|
||||
unset( $params['total_database_size'] );
|
||||
|
||||
// Unset completed flag
|
||||
unset( $params['completed'] );
|
||||
|
||||
} else {
|
||||
|
||||
// Get archive bytes offset
|
||||
$archive_bytes_offset = $archive->get_file_pointer();
|
||||
|
||||
// What percent of database have we processed?
|
||||
$progress = (int) min( ( $database_bytes_offset / $total_database_size ) * 100, 100 );
|
||||
|
||||
// Set progress
|
||||
Ai1wm_Status::info( sprintf( __( 'Archiving database...<br />%d%% complete', AI1WM_PLUGIN_NAME ), $progress ) );
|
||||
|
||||
// Set archive bytes offset
|
||||
$params['archive_bytes_offset'] = $archive_bytes_offset;
|
||||
|
||||
// Set database bytes offset
|
||||
$params['database_bytes_offset'] = $database_bytes_offset;
|
||||
|
||||
// Set total database size
|
||||
$params['total_database_size'] = $total_database_size;
|
||||
|
||||
// Set completed flag
|
||||
$params['completed'] = false;
|
||||
}
|
||||
|
||||
// Truncate the archive file
|
||||
$archive->truncate();
|
||||
|
||||
// Close the archive file
|
||||
$archive->close();
|
||||
|
||||
return $params;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,207 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2014-2020 ServMask Inc.
|
||||
*
|
||||
* 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/>.
|
||||
*
|
||||
* ███████╗███████╗██████╗ ██╗ ██╗███╗ ███╗ █████╗ ███████╗██╗ ██╗
|
||||
* ██╔════╝██╔════╝██╔══██╗██║ ██║████╗ ████║██╔══██╗██╔════╝██║ ██╔╝
|
||||
* ███████╗█████╗ ██████╔╝██║ ██║██╔████╔██║███████║███████╗█████╔╝
|
||||
* ╚════██║██╔══╝ ██╔══██╗╚██╗ ██╔╝██║╚██╔╝██║██╔══██║╚════██║██╔═██╗
|
||||
* ███████║███████╗██║ ██║ ╚████╔╝ ██║ ╚═╝ ██║██║ ██║███████║██║ ██╗
|
||||
* ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
die( 'Kangaroos cannot jump here' );
|
||||
}
|
||||
|
||||
class Ai1wm_Export_Database {
|
||||
|
||||
public static function execute( $params ) {
|
||||
global $wpdb;
|
||||
|
||||
// Set exclude database
|
||||
if ( isset( $params['options']['no_database'] ) ) {
|
||||
return $params;
|
||||
}
|
||||
|
||||
// Set query offset
|
||||
if ( isset( $params['query_offset'] ) ) {
|
||||
$query_offset = (int) $params['query_offset'];
|
||||
} else {
|
||||
$query_offset = 0;
|
||||
}
|
||||
|
||||
// Set table index
|
||||
if ( isset( $params['table_index'] ) ) {
|
||||
$table_index = (int) $params['table_index'];
|
||||
} else {
|
||||
$table_index = 0;
|
||||
}
|
||||
|
||||
// Set table offset
|
||||
if ( isset( $params['table_offset'] ) ) {
|
||||
$table_offset = (int) $params['table_offset'];
|
||||
} else {
|
||||
$table_offset = 0;
|
||||
}
|
||||
|
||||
// Set table rows
|
||||
if ( isset( $params['table_rows'] ) ) {
|
||||
$table_rows = (int) $params['table_rows'];
|
||||
} else {
|
||||
$table_rows = 0;
|
||||
}
|
||||
|
||||
// Set total tables count
|
||||
if ( isset( $params['total_tables_count'] ) ) {
|
||||
$total_tables_count = (int) $params['total_tables_count'];
|
||||
} else {
|
||||
$total_tables_count = 1;
|
||||
}
|
||||
|
||||
// What percent of tables have we processed?
|
||||
$progress = (int) ( ( $table_index / $total_tables_count ) * 100 );
|
||||
|
||||
// Set progress
|
||||
Ai1wm_Status::info( sprintf( __( 'Exporting database...<br />%d%% complete<br />%s records saved', AI1WM_PLUGIN_NAME ), $progress, number_format_i18n( $table_rows ) ) );
|
||||
|
||||
// Get tables list file
|
||||
$tables_list = ai1wm_open( ai1wm_tables_list_path( $params ), 'r' );
|
||||
|
||||
// Loop over tables
|
||||
$tables = array();
|
||||
while ( list( $table_name ) = fgetcsv( $tables_list ) ) {
|
||||
$tables[] = $table_name;
|
||||
}
|
||||
|
||||
// Close the tables list file
|
||||
ai1wm_close( $tables_list );
|
||||
|
||||
// Get database client
|
||||
if ( empty( $wpdb->use_mysqli ) ) {
|
||||
$mysql = new Ai1wm_Database_Mysql( $wpdb );
|
||||
} else {
|
||||
$mysql = new Ai1wm_Database_Mysqli( $wpdb );
|
||||
}
|
||||
|
||||
// Exclude spam comments
|
||||
if ( isset( $params['options']['no_spam_comments'] ) ) {
|
||||
$mysql->set_table_where_query( ai1wm_table_prefix() . 'comments', "`comment_approved` != 'spam'" )
|
||||
->set_table_where_query( ai1wm_table_prefix() . 'commentmeta', sprintf( "`comment_ID` IN ( SELECT `comment_ID` FROM `%s` WHERE `comment_approved` != 'spam' )", ai1wm_table_prefix() . 'comments' ) );
|
||||
}
|
||||
|
||||
// Exclude post revisions
|
||||
if ( isset( $params['options']['no_post_revisions'] ) ) {
|
||||
$mysql->set_table_where_query( ai1wm_table_prefix() . 'posts', "`post_type` != 'revision'" );
|
||||
}
|
||||
|
||||
$old_table_prefixes = $old_column_prefixes = array();
|
||||
$new_table_prefixes = $new_column_prefixes = array();
|
||||
|
||||
// Set table and column prefixes
|
||||
if ( ai1wm_table_prefix() ) {
|
||||
$old_table_prefixes[] = $old_column_prefixes[] = ai1wm_table_prefix();
|
||||
$new_table_prefixes[] = $new_column_prefixes[] = ai1wm_servmask_prefix();
|
||||
} else {
|
||||
// Set table prefixes based on table name
|
||||
foreach ( $tables as $table_name ) {
|
||||
$old_table_prefixes[] = $table_name;
|
||||
$new_table_prefixes[] = ai1wm_servmask_prefix() . $table_name;
|
||||
}
|
||||
|
||||
// Set table prefixes based on column name
|
||||
foreach ( array( 'user_roles', 'capabilities', 'user_level', 'dashboard_quick_press_last_post_id', 'user-settings', 'user-settings-time' ) as $column_prefix ) {
|
||||
$old_column_prefixes[] = $column_prefix;
|
||||
$new_column_prefixes[] = ai1wm_servmask_prefix() . $column_prefix;
|
||||
}
|
||||
}
|
||||
|
||||
$mysql->set_tables( $tables )
|
||||
->set_old_table_prefixes( $old_table_prefixes )
|
||||
->set_new_table_prefixes( $new_table_prefixes )
|
||||
->set_old_column_prefixes( $old_column_prefixes )
|
||||
->set_new_column_prefixes( $new_column_prefixes );
|
||||
|
||||
// Exclude site options
|
||||
$mysql->set_table_where_query( ai1wm_table_prefix() . 'options', sprintf( "`option_name` NOT IN ('%s', '%s', '%s', '%s', '%s', '%s')", AI1WM_STATUS, AI1WM_SECRET_KEY, AI1WM_AUTH_USER, AI1WM_AUTH_PASSWORD, AI1WM_BACKUPS_LABELS, AI1WM_SITES_LINKS ) );
|
||||
|
||||
// Set table select columns
|
||||
if ( ( $column_names = $mysql->get_column_names( ai1wm_table_prefix() . 'options' ) ) ) {
|
||||
if ( isset( $column_names['option_name'], $column_names['option_value'] ) ) {
|
||||
$column_names['option_value'] = sprintf( "(CASE WHEN option_name = '%s' THEN 'a:0:{}' WHEN (option_name = '%s' OR option_name = '%s') THEN '' ELSE option_value END) AS option_value", AI1WM_ACTIVE_PLUGINS, AI1WM_ACTIVE_TEMPLATE, AI1WM_ACTIVE_STYLESHEET );
|
||||
}
|
||||
|
||||
$mysql->set_table_select_columns( ai1wm_table_prefix() . 'options', $column_names );
|
||||
}
|
||||
|
||||
// Set table prefix columns
|
||||
$mysql->set_table_prefix_columns( ai1wm_table_prefix() . 'options', array( 'option_name' ) )
|
||||
->set_table_prefix_columns( ai1wm_table_prefix() . 'usermeta', array( 'meta_key' ) );
|
||||
|
||||
// Export database
|
||||
if ( $mysql->export( ai1wm_database_path( $params ), $query_offset, $table_index, $table_offset, $table_rows ) ) {
|
||||
|
||||
// Set progress
|
||||
Ai1wm_Status::info( __( 'Done exporting database.', AI1WM_PLUGIN_NAME ) );
|
||||
|
||||
// Unset query offset
|
||||
unset( $params['query_offset'] );
|
||||
|
||||
// Unset table index
|
||||
unset( $params['table_index'] );
|
||||
|
||||
// Unset table offset
|
||||
unset( $params['table_offset'] );
|
||||
|
||||
// Unset table rows
|
||||
unset( $params['table_rows'] );
|
||||
|
||||
// Unset total tables count
|
||||
unset( $params['total_tables_count'] );
|
||||
|
||||
// Unset completed flag
|
||||
unset( $params['completed'] );
|
||||
|
||||
} else {
|
||||
|
||||
// What percent of tables have we processed?
|
||||
$progress = (int) ( ( $table_index / $total_tables_count ) * 100 );
|
||||
|
||||
// Set progress
|
||||
Ai1wm_Status::info( sprintf( __( 'Exporting database...<br />%d%% complete<br />%s records saved', AI1WM_PLUGIN_NAME ), $progress, number_format_i18n( $table_rows ) ) );
|
||||
|
||||
// Set query offset
|
||||
$params['query_offset'] = $query_offset;
|
||||
|
||||
// Set table index
|
||||
$params['table_index'] = $table_index;
|
||||
|
||||
// Set table offset
|
||||
$params['table_offset'] = $table_offset;
|
||||
|
||||
// Set table rows
|
||||
$params['table_rows'] = $table_rows;
|
||||
|
||||
// Set total tables count
|
||||
$params['total_tables_count'] = $total_tables_count;
|
||||
|
||||
// Set completed flag
|
||||
$params['completed'] = false;
|
||||
}
|
||||
|
||||
return $params;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2014-2020 ServMask Inc.
|
||||
*
|
||||
* 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/>.
|
||||
*
|
||||
* ███████╗███████╗██████╗ ██╗ ██╗███╗ ███╗ █████╗ ███████╗██╗ ██╗
|
||||
* ██╔════╝██╔════╝██╔══██╗██║ ██║████╗ ████║██╔══██╗██╔════╝██║ ██╔╝
|
||||
* ███████╗█████╗ ██████╔╝██║ ██║██╔████╔██║███████║███████╗█████╔╝
|
||||
* ╚════██║██╔══╝ ██╔══██╗╚██╗ ██╔╝██║╚██╔╝██║██╔══██║╚════██║██╔═██╗
|
||||
* ███████║███████╗██║ ██║ ╚████╔╝ ██║ ╚═╝ ██║██║ ██║███████║██║ ██╗
|
||||
* ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
die( 'Kangaroos cannot jump here' );
|
||||
}
|
||||
|
||||
class Ai1wm_Export_Download {
|
||||
|
||||
public static function execute( $params ) {
|
||||
|
||||
// Set progress
|
||||
Ai1wm_Status::info( __( 'Renaming exported file...', AI1WM_PLUGIN_NAME ) );
|
||||
|
||||
// Open the archive file for writing
|
||||
$archive = new Ai1wm_Compressor( ai1wm_archive_path( $params ) );
|
||||
|
||||
// Append EOF block
|
||||
$archive->close( true );
|
||||
|
||||
// Rename archive file
|
||||
if ( rename( ai1wm_archive_path( $params ), ai1wm_backup_path( $params ) ) ) {
|
||||
|
||||
$blog_id = null;
|
||||
|
||||
// Get subsite Blog ID
|
||||
if ( isset( $params['options']['sites'] ) && ( $sites = $params['options']['sites'] ) ) {
|
||||
if ( count( $sites ) === 1 ) {
|
||||
$blog_id = array_shift( $sites );
|
||||
}
|
||||
}
|
||||
|
||||
// Set archive details
|
||||
$file = ai1wm_archive_name( $params );
|
||||
$link = ai1wm_backup_url( $params );
|
||||
$size = ai1wm_backup_size( $params );
|
||||
$name = ai1wm_site_name( $blog_id );
|
||||
|
||||
// Set progress
|
||||
Ai1wm_Status::download(
|
||||
sprintf(
|
||||
__(
|
||||
'<a href="%s" class="ai1wm-button-green ai1wm-emphasize ai1wm-button-download" title="%s" download="%s">' .
|
||||
'<span>Download %s</span>' .
|
||||
'<em>Size: %s</em>' .
|
||||
'</a>',
|
||||
AI1WM_PLUGIN_NAME
|
||||
),
|
||||
$link,
|
||||
$name,
|
||||
$file,
|
||||
$name,
|
||||
$size
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
return $params;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,119 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2014-2020 ServMask Inc.
|
||||
*
|
||||
* 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/>.
|
||||
*
|
||||
* ███████╗███████╗██████╗ ██╗ ██╗███╗ ███╗ █████╗ ███████╗██╗ ██╗
|
||||
* ██╔════╝██╔════╝██╔══██╗██║ ██║████╗ ████║██╔══██╗██╔════╝██║ ██╔╝
|
||||
* ███████╗█████╗ ██████╔╝██║ ██║██╔████╔██║███████║███████╗█████╔╝
|
||||
* ╚════██║██╔══╝ ██╔══██╗╚██╗ ██╔╝██║╚██╔╝██║██╔══██║╚════██║██╔═██╗
|
||||
* ███████║███████╗██║ ██║ ╚████╔╝ ██║ ╚═╝ ██║██║ ██║███████║██║ ██╗
|
||||
* ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
die( 'Kangaroos cannot jump here' );
|
||||
}
|
||||
|
||||
class Ai1wm_Export_Enumerate_Content {
|
||||
|
||||
public static function execute( $params ) {
|
||||
|
||||
$exclude_filters = array_merge( array( ai1wm_get_uploads_dir(), ai1wm_get_plugins_dir() ), ai1wm_get_themes_dirs() );
|
||||
|
||||
// Get total content files count
|
||||
if ( isset( $params['total_content_files_count'] ) ) {
|
||||
$total_content_files_count = (int) $params['total_content_files_count'];
|
||||
} else {
|
||||
$total_content_files_count = 1;
|
||||
}
|
||||
|
||||
// Get total content files size
|
||||
if ( isset( $params['total_content_files_size'] ) ) {
|
||||
$total_content_files_size = (int) $params['total_content_files_size'];
|
||||
} else {
|
||||
$total_content_files_size = 1;
|
||||
}
|
||||
|
||||
// Set progress
|
||||
Ai1wm_Status::info( __( 'Retrieving a list of WordPress content files...', AI1WM_PLUGIN_NAME ) );
|
||||
|
||||
// Exclude cache
|
||||
if ( isset( $params['options']['no_cache'] ) ) {
|
||||
$exclude_filters[] = 'cache';
|
||||
}
|
||||
|
||||
// Exclude must-use plugins
|
||||
if ( isset( $params['options']['no_muplugins'] ) ) {
|
||||
$exclude_filters[] = 'mu-plugins';
|
||||
}
|
||||
|
||||
// Exclude media
|
||||
if ( isset( $params['options']['no_media'] ) ) {
|
||||
$exclude_filters[] = 'blogs.dir';
|
||||
}
|
||||
|
||||
// Exclude selected files
|
||||
if ( isset( $params['options']['exclude_files'], $params['excluded_files'] ) ) {
|
||||
if ( ( $excluded_files = explode( ',', $params['excluded_files'] ) ) ) {
|
||||
foreach ( $excluded_files as $excluded_path ) {
|
||||
$exclude_filters[] = WP_CONTENT_DIR . DIRECTORY_SEPARATOR . untrailingslashit( $excluded_path );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Create content list file
|
||||
$content_list = ai1wm_open( ai1wm_content_list_path( $params ), 'w' );
|
||||
|
||||
// Enumerate over content directory
|
||||
if ( isset( $params['options']['no_themes'], $params['options']['no_muplugins'], $params['options']['no_plugins'] ) === false ) {
|
||||
|
||||
// Iterate over content directory
|
||||
$iterator = new Ai1wm_Recursive_Directory_Iterator( WP_CONTENT_DIR );
|
||||
|
||||
// Exclude content files
|
||||
$iterator = new Ai1wm_Recursive_Exclude_Filter( $iterator, apply_filters( 'ai1wm_exclude_content_from_export', ai1wm_content_filters( $exclude_filters ) ) );
|
||||
|
||||
// Recursively iterate over content directory
|
||||
$iterator = new Ai1wm_Recursive_Iterator_Iterator( $iterator, RecursiveIteratorIterator::LEAVES_ONLY, RecursiveIteratorIterator::CATCH_GET_CHILD );
|
||||
|
||||
// Write path line
|
||||
foreach ( $iterator as $item ) {
|
||||
if ( $item->isFile() ) {
|
||||
if ( ai1wm_putcsv( $content_list, array( $iterator->getPathname(), $iterator->getSubPathname(), $iterator->getSize(), $iterator->getMTime() ) ) ) {
|
||||
$total_content_files_count++;
|
||||
|
||||
// Add current file size
|
||||
$total_content_files_size += $iterator->getSize();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Set progress
|
||||
Ai1wm_Status::info( __( 'Done retrieving a list of WordPress content files.', AI1WM_PLUGIN_NAME ) );
|
||||
|
||||
// Set total content files count
|
||||
$params['total_content_files_count'] = $total_content_files_count;
|
||||
|
||||
// Set total content files size
|
||||
$params['total_content_files_size'] = $total_content_files_size;
|
||||
|
||||
// Close the content list file
|
||||
ai1wm_close( $content_list );
|
||||
|
||||
return $params;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,106 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2014-2020 ServMask Inc.
|
||||
*
|
||||
* 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/>.
|
||||
*
|
||||
* ███████╗███████╗██████╗ ██╗ ██╗███╗ ███╗ █████╗ ███████╗██╗ ██╗
|
||||
* ██╔════╝██╔════╝██╔══██╗██║ ██║████╗ ████║██╔══██╗██╔════╝██║ ██╔╝
|
||||
* ███████╗█████╗ ██████╔╝██║ ██║██╔████╔██║███████║███████╗█████╔╝
|
||||
* ╚════██║██╔══╝ ██╔══██╗╚██╗ ██╔╝██║╚██╔╝██║██╔══██║╚════██║██╔═██╗
|
||||
* ███████║███████╗██║ ██║ ╚████╔╝ ██║ ╚═╝ ██║██║ ██║███████║██║ ██╗
|
||||
* ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
die( 'Kangaroos cannot jump here' );
|
||||
}
|
||||
|
||||
class Ai1wm_Export_Enumerate_Media {
|
||||
|
||||
public static function execute( $params ) {
|
||||
|
||||
$exclude_filters = array();
|
||||
|
||||
// Get total media files count
|
||||
if ( isset( $params['total_media_files_count'] ) ) {
|
||||
$total_media_files_count = (int) $params['total_media_files_count'];
|
||||
} else {
|
||||
$total_media_files_count = 1;
|
||||
}
|
||||
|
||||
// Get total media files size
|
||||
if ( isset( $params['total_media_files_size'] ) ) {
|
||||
$total_media_files_size = (int) $params['total_media_files_size'];
|
||||
} else {
|
||||
$total_media_files_size = 1;
|
||||
}
|
||||
|
||||
// Set progress
|
||||
Ai1wm_Status::info( __( 'Retrieving a list of WordPress media files...', AI1WM_PLUGIN_NAME ) );
|
||||
|
||||
// Exclude selected files
|
||||
if ( isset( $params['options']['exclude_files'], $params['excluded_files'] ) ) {
|
||||
if ( ( $excluded_files = explode( ',', $params['excluded_files'] ) ) ) {
|
||||
foreach ( $excluded_files as $excluded_path ) {
|
||||
$exclude_filters[] = WP_CONTENT_DIR . DIRECTORY_SEPARATOR . untrailingslashit( $excluded_path );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Create media list file
|
||||
$media_list = ai1wm_open( ai1wm_media_list_path( $params ), 'w' );
|
||||
|
||||
// Enumerate over media directory
|
||||
if ( isset( $params['options']['no_media'] ) === false ) {
|
||||
if ( is_dir( ai1wm_get_uploads_dir() ) ) {
|
||||
|
||||
// Iterate over media directory
|
||||
$iterator = new Ai1wm_Recursive_Directory_Iterator( ai1wm_get_uploads_dir() );
|
||||
|
||||
// Exclude media files
|
||||
$iterator = new Ai1wm_Recursive_Exclude_Filter( $iterator, apply_filters( 'ai1wm_exclude_media_from_export', $exclude_filters ) );
|
||||
|
||||
// Recursively iterate over content directory
|
||||
$iterator = new Ai1wm_Recursive_Iterator_Iterator( $iterator, RecursiveIteratorIterator::LEAVES_ONLY, RecursiveIteratorIterator::CATCH_GET_CHILD );
|
||||
|
||||
// Write path line
|
||||
foreach ( $iterator as $item ) {
|
||||
if ( $item->isFile() ) {
|
||||
if ( ai1wm_putcsv( $media_list, array( $iterator->getPathname(), $iterator->getSubPathname(), $iterator->getSize(), $iterator->getMTime() ) ) ) {
|
||||
$total_media_files_count++;
|
||||
|
||||
// Add current file size
|
||||
$total_media_files_size += $iterator->getSize();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Set progress
|
||||
Ai1wm_Status::info( __( 'Done retrieving a list of WordPress media files.', AI1WM_PLUGIN_NAME ) );
|
||||
|
||||
// Set total media files count
|
||||
$params['total_media_files_count'] = $total_media_files_count;
|
||||
|
||||
// Set total media files size
|
||||
$params['total_media_files_size'] = $total_media_files_size;
|
||||
|
||||
// Close the media list file
|
||||
ai1wm_close( $media_list );
|
||||
|
||||
return $params;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,113 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2014-2020 ServMask Inc.
|
||||
*
|
||||
* 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/>.
|
||||
*
|
||||
* ███████╗███████╗██████╗ ██╗ ██╗███╗ ███╗ █████╗ ███████╗██╗ ██╗
|
||||
* ██╔════╝██╔════╝██╔══██╗██║ ██║████╗ ████║██╔══██╗██╔════╝██║ ██╔╝
|
||||
* ███████╗█████╗ ██████╔╝██║ ██║██╔████╔██║███████║███████╗█████╔╝
|
||||
* ╚════██║██╔══╝ ██╔══██╗╚██╗ ██╔╝██║╚██╔╝██║██╔══██║╚════██║██╔═██╗
|
||||
* ███████║███████╗██║ ██║ ╚████╔╝ ██║ ╚═╝ ██║██║ ██║███████║██║ ██╗
|
||||
* ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
die( 'Kangaroos cannot jump here' );
|
||||
}
|
||||
|
||||
class Ai1wm_Export_Enumerate_Plugins {
|
||||
|
||||
public static function execute( $params ) {
|
||||
|
||||
$exclude_filters = array();
|
||||
|
||||
// Get total plugins files count
|
||||
if ( isset( $params['total_plugins_files_count'] ) ) {
|
||||
$total_plugins_files_count = (int) $params['total_plugins_files_count'];
|
||||
} else {
|
||||
$total_plugins_files_count = 1;
|
||||
}
|
||||
|
||||
// Get total plugins files size
|
||||
if ( isset( $params['total_plugins_files_size'] ) ) {
|
||||
$total_plugins_files_size = (int) $params['total_plugins_files_size'];
|
||||
} else {
|
||||
$total_plugins_files_size = 1;
|
||||
}
|
||||
|
||||
// Set progress
|
||||
Ai1wm_Status::info( __( 'Retrieving a list of WordPress plugin files...', AI1WM_PLUGIN_NAME ) );
|
||||
|
||||
// Exclude inactive plugins
|
||||
if ( isset( $params['options']['no_inactive_plugins'] ) ) {
|
||||
foreach ( get_plugins() as $plugin_name => $plugin_info ) {
|
||||
if ( is_plugin_inactive( $plugin_name ) ) {
|
||||
$exclude_filters[] = ( dirname( $plugin_name ) === '.' ? basename( $plugin_name ) : dirname( $plugin_name ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Exclude selected files
|
||||
if ( isset( $params['options']['exclude_files'], $params['excluded_files'] ) ) {
|
||||
if ( ( $excluded_files = explode( ',', $params['excluded_files'] ) ) ) {
|
||||
foreach ( $excluded_files as $excluded_path ) {
|
||||
$exclude_filters[] = WP_CONTENT_DIR . DIRECTORY_SEPARATOR . untrailingslashit( $excluded_path );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Create plugins list file
|
||||
$plugins_list = ai1wm_open( ai1wm_plugins_list_path( $params ), 'w' );
|
||||
|
||||
// Enumerate over plugins directory
|
||||
if ( isset( $params['options']['no_plugins'] ) === false ) {
|
||||
|
||||
// Iterate over plugins directory
|
||||
$iterator = new Ai1wm_Recursive_Directory_Iterator( ai1wm_get_plugins_dir() );
|
||||
|
||||
// Exclude plugins files
|
||||
$iterator = new Ai1wm_Recursive_Exclude_Filter( $iterator, apply_filters( 'ai1wm_exclude_plugins_from_export', ai1wm_plugin_filters( $exclude_filters ) ) );
|
||||
|
||||
// Recursively iterate over plugins directory
|
||||
$iterator = new Ai1wm_Recursive_Iterator_Iterator( $iterator, RecursiveIteratorIterator::LEAVES_ONLY, RecursiveIteratorIterator::CATCH_GET_CHILD );
|
||||
|
||||
// Write path line
|
||||
foreach ( $iterator as $item ) {
|
||||
if ( $item->isFile() ) {
|
||||
if ( ai1wm_putcsv( $plugins_list, array( $iterator->getPathname(), $iterator->getSubPathname(), $iterator->getSize(), $iterator->getMTime() ) ) ) {
|
||||
$total_plugins_files_count++;
|
||||
|
||||
// Add current file size
|
||||
$total_plugins_files_size += $iterator->getSize();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Set progress
|
||||
Ai1wm_Status::info( __( 'Done retrieving a list of WordPress plugin files.', AI1WM_PLUGIN_NAME ) );
|
||||
|
||||
// Set total plugins files count
|
||||
$params['total_plugins_files_count'] = $total_plugins_files_count;
|
||||
|
||||
// Set total plugins files size
|
||||
$params['total_plugins_files_size'] = $total_plugins_files_size;
|
||||
|
||||
// Close the plugins list file
|
||||
ai1wm_close( $plugins_list );
|
||||
|
||||
return $params;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,94 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2014-2020 ServMask Inc.
|
||||
*
|
||||
* 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/>.
|
||||
*
|
||||
* ███████╗███████╗██████╗ ██╗ ██╗███╗ ███╗ █████╗ ███████╗██╗ ██╗
|
||||
* ██╔════╝██╔════╝██╔══██╗██║ ██║████╗ ████║██╔══██╗██╔════╝██║ ██╔╝
|
||||
* ███████╗█████╗ ██████╔╝██║ ██║██╔████╔██║███████║███████╗█████╔╝
|
||||
* ╚════██║██╔══╝ ██╔══██╗╚██╗ ██╔╝██║╚██╔╝██║██╔══██║╚════██║██╔═██╗
|
||||
* ███████║███████╗██║ ██║ ╚████╔╝ ██║ ╚═╝ ██║██║ ██║███████║██║ ██╗
|
||||
* ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
die( 'Kangaroos cannot jump here' );
|
||||
}
|
||||
|
||||
class Ai1wm_Export_Enumerate_Tables {
|
||||
|
||||
public static function execute( $params, Ai1wm_Database $mysql = null ) {
|
||||
global $wpdb;
|
||||
|
||||
// Set exclude database
|
||||
if ( isset( $params['options']['no_database'] ) ) {
|
||||
return $params;
|
||||
}
|
||||
|
||||
// Get total tables count
|
||||
if ( isset( $params['total_tables_count'] ) ) {
|
||||
$total_tables_count = (int) $params['total_tables_count'];
|
||||
} else {
|
||||
$total_tables_count = 1;
|
||||
}
|
||||
|
||||
// Set progress
|
||||
Ai1wm_Status::info( __( 'Retrieving a list of WordPress database tables...', AI1WM_PLUGIN_NAME ) );
|
||||
|
||||
// Get database client
|
||||
if ( is_null( $mysql ) ) {
|
||||
if ( empty( $wpdb->use_mysqli ) ) {
|
||||
$mysql = new Ai1wm_Database_Mysql( $wpdb );
|
||||
} else {
|
||||
$mysql = new Ai1wm_Database_Mysqli( $wpdb );
|
||||
}
|
||||
}
|
||||
|
||||
// Include table prefixes
|
||||
if ( ai1wm_table_prefix() ) {
|
||||
$mysql->add_table_prefix_filter( ai1wm_table_prefix() );
|
||||
} else {
|
||||
foreach ( $mysql->get_tables() as $table_name ) {
|
||||
$mysql->add_table_prefix_filter( $table_name );
|
||||
}
|
||||
}
|
||||
|
||||
// Include table prefixes (Webba Booking)
|
||||
foreach ( array( 'wbk_services', 'wbk_days_on_off', 'wbk_locked_time_slots', 'wbk_appointments', 'wbk_cancelled_appointments', 'wbk_email_templates', 'wbk_service_categories', 'wbk_gg_calendars', 'wbk_coupons' ) as $table_name ) {
|
||||
$mysql->add_table_prefix_filter( $table_name );
|
||||
}
|
||||
|
||||
// Create tables list file
|
||||
$tables_list = ai1wm_open( ai1wm_tables_list_path( $params ), 'w' );
|
||||
|
||||
// Write table line
|
||||
foreach ( $mysql->get_tables() as $table_name ) {
|
||||
if ( ai1wm_putcsv( $tables_list, array( $table_name ) ) ) {
|
||||
$total_tables_count++;
|
||||
}
|
||||
}
|
||||
|
||||
// Set progress
|
||||
Ai1wm_Status::info( __( 'Done retrieving a list of WordPress database tables.', AI1WM_PLUGIN_NAME ) );
|
||||
|
||||
// Set total tables count
|
||||
$params['total_tables_count'] = $total_tables_count;
|
||||
|
||||
// Close the tables list file
|
||||
ai1wm_close( $tables_list );
|
||||
|
||||
return $params;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,119 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2014-2020 ServMask Inc.
|
||||
*
|
||||
* 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/>.
|
||||
*
|
||||
* ███████╗███████╗██████╗ ██╗ ██╗███╗ ███╗ █████╗ ███████╗██╗ ██╗
|
||||
* ██╔════╝██╔════╝██╔══██╗██║ ██║████╗ ████║██╔══██╗██╔════╝██║ ██╔╝
|
||||
* ███████╗█████╗ ██████╔╝██║ ██║██╔████╔██║███████║███████╗█████╔╝
|
||||
* ╚════██║██╔══╝ ██╔══██╗╚██╗ ██╔╝██║╚██╔╝██║██╔══██║╚════██║██╔═██╗
|
||||
* ███████║███████╗██║ ██║ ╚████╔╝ ██║ ╚═╝ ██║██║ ██║███████║██║ ██╗
|
||||
* ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
die( 'Kangaroos cannot jump here' );
|
||||
}
|
||||
|
||||
class Ai1wm_Export_Enumerate_Themes {
|
||||
|
||||
public static function execute( $params ) {
|
||||
|
||||
$exclude_filters = array();
|
||||
|
||||
// Get total themes files count
|
||||
if ( isset( $params['total_themes_files_count'] ) ) {
|
||||
$total_themes_files_count = (int) $params['total_themes_files_count'];
|
||||
} else {
|
||||
$total_themes_files_count = 1;
|
||||
}
|
||||
|
||||
// Get total themes files size
|
||||
if ( isset( $params['total_themes_files_size'] ) ) {
|
||||
$total_themes_files_size = (int) $params['total_themes_files_size'];
|
||||
} else {
|
||||
$total_themes_files_size = 1;
|
||||
}
|
||||
|
||||
// Set progress
|
||||
Ai1wm_Status::info( __( 'Retrieving a list of WordPress theme files...', AI1WM_PLUGIN_NAME ) );
|
||||
|
||||
// Exclude inactive themes
|
||||
if ( isset( $params['options']['no_inactive_themes'] ) ) {
|
||||
foreach ( search_theme_directories() as $theme_name => $theme_info ) {
|
||||
if ( ! in_array( $theme_name, array( get_template(), get_stylesheet() ) ) ) {
|
||||
if ( isset( $theme_info['theme_root'] ) ) {
|
||||
$exclude_filters[] = $theme_info['theme_root'] . DIRECTORY_SEPARATOR . $theme_name;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Exclude selected files
|
||||
if ( isset( $params['options']['exclude_files'], $params['excluded_files'] ) ) {
|
||||
if ( ( $excluded_files = explode( ',', $params['excluded_files'] ) ) ) {
|
||||
foreach ( $excluded_files as $excluded_path ) {
|
||||
$exclude_filters[] = WP_CONTENT_DIR . DIRECTORY_SEPARATOR . untrailingslashit( $excluded_path );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Create themes list file
|
||||
$themes_list = ai1wm_open( ai1wm_themes_list_path( $params ), 'w' );
|
||||
|
||||
// Enumerate over themes directory
|
||||
if ( isset( $params['options']['no_themes'] ) === false ) {
|
||||
foreach ( ai1wm_get_themes_dirs() as $theme_dir ) {
|
||||
if ( is_dir( $theme_dir ) ) {
|
||||
|
||||
// Iterate over themes directory
|
||||
$iterator = new Ai1wm_Recursive_Directory_Iterator( $theme_dir );
|
||||
|
||||
// Exclude themes files
|
||||
$iterator = new Ai1wm_Recursive_Exclude_Filter( $iterator, apply_filters( 'ai1wm_exclude_themes_from_export', $exclude_filters ) );
|
||||
|
||||
// Recursively iterate over themes directory
|
||||
$iterator = new Ai1wm_Recursive_Iterator_Iterator( $iterator, RecursiveIteratorIterator::LEAVES_ONLY, RecursiveIteratorIterator::CATCH_GET_CHILD );
|
||||
|
||||
// Write path line
|
||||
foreach ( $iterator as $item ) {
|
||||
if ( $item->isFile() ) {
|
||||
if ( ai1wm_putcsv( $themes_list, array( $iterator->getPathname(), $iterator->getSubPathname(), $iterator->getSize(), $iterator->getMTime() ) ) ) {
|
||||
$total_themes_files_count++;
|
||||
|
||||
// Add current file size
|
||||
$total_themes_files_size += $iterator->getSize();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Set progress
|
||||
Ai1wm_Status::info( __( 'Done retrieving a list of WordPress theme files.', AI1WM_PLUGIN_NAME ) );
|
||||
|
||||
// Set total themes files count
|
||||
$params['total_themes_files_count'] = $total_themes_files_count;
|
||||
|
||||
// Set total themes files size
|
||||
$params['total_themes_files_size'] = $total_themes_files_size;
|
||||
|
||||
// Close the themes list file
|
||||
ai1wm_close( $themes_list );
|
||||
|
||||
return $params;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2014-2020 ServMask Inc.
|
||||
*
|
||||
* 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/>.
|
||||
*
|
||||
* ███████╗███████╗██████╗ ██╗ ██╗███╗ ███╗ █████╗ ███████╗██╗ ██╗
|
||||
* ██╔════╝██╔════╝██╔══██╗██║ ██║████╗ ████║██╔══██╗██╔════╝██║ ██╔╝
|
||||
* ███████╗█████╗ ██████╔╝██║ ██║██╔████╔██║███████║███████╗█████╔╝
|
||||
* ╚════██║██╔══╝ ██╔══██╗╚██╗ ██╔╝██║╚██╔╝██║██╔══██║╚════██║██╔═██╗
|
||||
* ███████║███████╗██║ ██║ ╚████╔╝ ██║ ╚═╝ ██║██║ ██║███████║██║ ██╗
|
||||
* ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
die( 'Kangaroos cannot jump here' );
|
||||
}
|
||||
|
||||
class Ai1wm_Export_Init {
|
||||
|
||||
public static function execute( $params ) {
|
||||
$blog_id = null;
|
||||
|
||||
// Get subsite Blog ID
|
||||
if ( isset( $params['options']['sites'] ) && ( $sites = $params['options']['sites'] ) ) {
|
||||
if ( count( $sites ) === 1 ) {
|
||||
$blog_id = array_shift( $sites );
|
||||
}
|
||||
}
|
||||
|
||||
// Set progress
|
||||
Ai1wm_Status::info( __( 'Preparing to export...', AI1WM_PLUGIN_NAME ) );
|
||||
|
||||
// Set archive
|
||||
if ( empty( $params['archive'] ) ) {
|
||||
$params['archive'] = ai1wm_archive_file( $blog_id );
|
||||
}
|
||||
|
||||
// Set storage
|
||||
if ( empty( $params['storage'] ) ) {
|
||||
$params['storage'] = ai1wm_storage_folder();
|
||||
}
|
||||
|
||||
return $params;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,193 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2014-2020 ServMask Inc.
|
||||
*
|
||||
* 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/>.
|
||||
*
|
||||
* ███████╗███████╗██████╗ ██╗ ██╗███╗ ███╗ █████╗ ███████╗██╗ ██╗
|
||||
* ██╔════╝██╔════╝██╔══██╗██║ ██║████╗ ████║██╔══██╗██╔════╝██║ ██╔╝
|
||||
* ███████╗█████╗ ██████╔╝██║ ██║██╔████╔██║███████║███████╗█████╔╝
|
||||
* ╚════██║██╔══╝ ██╔══██╗╚██╗ ██╔╝██║╚██╔╝██║██╔══██║╚════██║██╔═██╗
|
||||
* ███████║███████╗██║ ██║ ╚████╔╝ ██║ ╚═╝ ██║██║ ██║███████║██║ ██╗
|
||||
* ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
die( 'Kangaroos cannot jump here' );
|
||||
}
|
||||
|
||||
class Ai1wm_Export_Media {
|
||||
|
||||
public static function execute( $params ) {
|
||||
|
||||
// Set archive bytes offset
|
||||
if ( isset( $params['archive_bytes_offset'] ) ) {
|
||||
$archive_bytes_offset = (int) $params['archive_bytes_offset'];
|
||||
} else {
|
||||
$archive_bytes_offset = ai1wm_archive_bytes( $params );
|
||||
}
|
||||
|
||||
// Set file bytes offset
|
||||
if ( isset( $params['file_bytes_offset'] ) ) {
|
||||
$file_bytes_offset = (int) $params['file_bytes_offset'];
|
||||
} else {
|
||||
$file_bytes_offset = 0;
|
||||
}
|
||||
|
||||
// Set media bytes offset
|
||||
if ( isset( $params['media_bytes_offset'] ) ) {
|
||||
$media_bytes_offset = (int) $params['media_bytes_offset'];
|
||||
} else {
|
||||
$media_bytes_offset = 0;
|
||||
}
|
||||
|
||||
// Get processed files size
|
||||
if ( isset( $params['processed_files_size'] ) ) {
|
||||
$processed_files_size = (int) $params['processed_files_size'];
|
||||
} else {
|
||||
$processed_files_size = 0;
|
||||
}
|
||||
|
||||
// Get total media files size
|
||||
if ( isset( $params['total_media_files_size'] ) ) {
|
||||
$total_media_files_size = (int) $params['total_media_files_size'];
|
||||
} else {
|
||||
$total_media_files_size = 1;
|
||||
}
|
||||
|
||||
// Get total media files count
|
||||
if ( isset( $params['total_media_files_count'] ) ) {
|
||||
$total_media_files_count = (int) $params['total_media_files_count'];
|
||||
} else {
|
||||
$total_media_files_count = 1;
|
||||
}
|
||||
|
||||
// What percent of files have we processed?
|
||||
$progress = (int) min( ( $processed_files_size / $total_media_files_size ) * 100, 100 );
|
||||
|
||||
// Set progress
|
||||
Ai1wm_Status::info( sprintf( __( 'Archiving %d media files...<br />%d%% complete', AI1WM_PLUGIN_NAME ), $total_media_files_count, $progress ) );
|
||||
|
||||
// Flag to hold if file data has been processed
|
||||
$completed = true;
|
||||
|
||||
// Start time
|
||||
$start = microtime( true );
|
||||
|
||||
// Get media list file
|
||||
$media_list = ai1wm_open( ai1wm_media_list_path( $params ), 'r' );
|
||||
|
||||
// Set the file pointer at the current index
|
||||
if ( fseek( $media_list, $media_bytes_offset ) !== -1 ) {
|
||||
|
||||
// Open the archive file for writing
|
||||
$archive = new Ai1wm_Compressor( ai1wm_archive_path( $params ) );
|
||||
|
||||
// Set the file pointer to the one that we have saved
|
||||
$archive->set_file_pointer( $archive_bytes_offset );
|
||||
|
||||
// Loop over files
|
||||
while ( list( $file_abspath, $file_relpath, $file_size, $file_mtime ) = fgetcsv( $media_list ) ) {
|
||||
$file_bytes_written = 0;
|
||||
|
||||
// Add file to archive
|
||||
if ( ( $completed = $archive->add_file( $file_abspath, 'uploads' . DIRECTORY_SEPARATOR . $file_relpath, $file_bytes_written, $file_bytes_offset ) ) ) {
|
||||
$file_bytes_offset = 0;
|
||||
|
||||
// Get media bytes offset
|
||||
$media_bytes_offset = ftell( $media_list );
|
||||
}
|
||||
|
||||
// Increment processed files size
|
||||
$processed_files_size += $file_bytes_written;
|
||||
|
||||
// What percent of files have we processed?
|
||||
$progress = (int) min( ( $processed_files_size / $total_media_files_size ) * 100, 100 );
|
||||
|
||||
// Set progress
|
||||
Ai1wm_Status::info( sprintf( __( 'Archiving %d media files...<br />%d%% complete', AI1WM_PLUGIN_NAME ), $total_media_files_count, $progress ) );
|
||||
|
||||
// More than 10 seconds have passed, break and do another request
|
||||
if ( ( $timeout = apply_filters( 'ai1wm_completed_timeout', 10 ) ) ) {
|
||||
if ( ( microtime( true ) - $start ) > $timeout ) {
|
||||
$completed = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Get archive bytes offset
|
||||
$archive_bytes_offset = $archive->get_file_pointer();
|
||||
|
||||
// Truncate the archive file
|
||||
$archive->truncate();
|
||||
|
||||
// Close the archive file
|
||||
$archive->close();
|
||||
}
|
||||
|
||||
// End of the media list?
|
||||
if ( feof( $media_list ) ) {
|
||||
|
||||
// Unset archive bytes offset
|
||||
unset( $params['archive_bytes_offset'] );
|
||||
|
||||
// Unset file bytes offset
|
||||
unset( $params['file_bytes_offset'] );
|
||||
|
||||
// Unset media bytes offset
|
||||
unset( $params['media_bytes_offset'] );
|
||||
|
||||
// Unset processed files size
|
||||
unset( $params['processed_files_size'] );
|
||||
|
||||
// Unset total media files size
|
||||
unset( $params['total_media_files_size'] );
|
||||
|
||||
// Unset total media files count
|
||||
unset( $params['total_media_files_count'] );
|
||||
|
||||
// Unset completed flag
|
||||
unset( $params['completed'] );
|
||||
|
||||
} else {
|
||||
|
||||
// Set archive bytes offset
|
||||
$params['archive_bytes_offset'] = $archive_bytes_offset;
|
||||
|
||||
// Set file bytes offset
|
||||
$params['file_bytes_offset'] = $file_bytes_offset;
|
||||
|
||||
// Set media bytes offset
|
||||
$params['media_bytes_offset'] = $media_bytes_offset;
|
||||
|
||||
// Set processed files size
|
||||
$params['processed_files_size'] = $processed_files_size;
|
||||
|
||||
// Set total media files size
|
||||
$params['total_media_files_size'] = $total_media_files_size;
|
||||
|
||||
// Set total media files count
|
||||
$params['total_media_files_count'] = $total_media_files_count;
|
||||
|
||||
// Set completed flag
|
||||
$params['completed'] = $completed;
|
||||
}
|
||||
|
||||
// Close the media list file
|
||||
ai1wm_close( $media_list );
|
||||
|
||||
return $params;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,193 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2014-2020 ServMask Inc.
|
||||
*
|
||||
* 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/>.
|
||||
*
|
||||
* ███████╗███████╗██████╗ ██╗ ██╗███╗ ███╗ █████╗ ███████╗██╗ ██╗
|
||||
* ██╔════╝██╔════╝██╔══██╗██║ ██║████╗ ████║██╔══██╗██╔════╝██║ ██╔╝
|
||||
* ███████╗█████╗ ██████╔╝██║ ██║██╔████╔██║███████║███████╗█████╔╝
|
||||
* ╚════██║██╔══╝ ██╔══██╗╚██╗ ██╔╝██║╚██╔╝██║██╔══██║╚════██║██╔═██╗
|
||||
* ███████║███████╗██║ ██║ ╚████╔╝ ██║ ╚═╝ ██║██║ ██║███████║██║ ██╗
|
||||
* ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
die( 'Kangaroos cannot jump here' );
|
||||
}
|
||||
|
||||
class Ai1wm_Export_Plugins {
|
||||
|
||||
public static function execute( $params ) {
|
||||
|
||||
// Set archive bytes offset
|
||||
if ( isset( $params['archive_bytes_offset'] ) ) {
|
||||
$archive_bytes_offset = (int) $params['archive_bytes_offset'];
|
||||
} else {
|
||||
$archive_bytes_offset = ai1wm_archive_bytes( $params );
|
||||
}
|
||||
|
||||
// Set file bytes offset
|
||||
if ( isset( $params['file_bytes_offset'] ) ) {
|
||||
$file_bytes_offset = (int) $params['file_bytes_offset'];
|
||||
} else {
|
||||
$file_bytes_offset = 0;
|
||||
}
|
||||
|
||||
// Set plugins bytes offset
|
||||
if ( isset( $params['plugins_bytes_offset'] ) ) {
|
||||
$plugins_bytes_offset = (int) $params['plugins_bytes_offset'];
|
||||
} else {
|
||||
$plugins_bytes_offset = 0;
|
||||
}
|
||||
|
||||
// Get processed files size
|
||||
if ( isset( $params['processed_files_size'] ) ) {
|
||||
$processed_files_size = (int) $params['processed_files_size'];
|
||||
} else {
|
||||
$processed_files_size = 0;
|
||||
}
|
||||
|
||||
// Get total plugins files size
|
||||
if ( isset( $params['total_plugins_files_size'] ) ) {
|
||||
$total_plugins_files_size = (int) $params['total_plugins_files_size'];
|
||||
} else {
|
||||
$total_plugins_files_size = 1;
|
||||
}
|
||||
|
||||
// Get total plugins files count
|
||||
if ( isset( $params['total_plugins_files_count'] ) ) {
|
||||
$total_plugins_files_count = (int) $params['total_plugins_files_count'];
|
||||
} else {
|
||||
$total_plugins_files_count = 1;
|
||||
}
|
||||
|
||||
// What percent of files have we processed?
|
||||
$progress = (int) min( ( $processed_files_size / $total_plugins_files_size ) * 100, 100 );
|
||||
|
||||
// Set progress
|
||||
Ai1wm_Status::info( sprintf( __( 'Archiving %d plugin files...<br />%d%% complete', AI1WM_PLUGIN_NAME ), $total_plugins_files_count, $progress ) );
|
||||
|
||||
// Flag to hold if file data has been processed
|
||||
$completed = true;
|
||||
|
||||
// Start time
|
||||
$start = microtime( true );
|
||||
|
||||
// Get plugins list file
|
||||
$plugins_list = ai1wm_open( ai1wm_plugins_list_path( $params ), 'r' );
|
||||
|
||||
// Set the file pointer at the current index
|
||||
if ( fseek( $plugins_list, $plugins_bytes_offset ) !== -1 ) {
|
||||
|
||||
// Open the archive file for writing
|
||||
$archive = new Ai1wm_Compressor( ai1wm_archive_path( $params ) );
|
||||
|
||||
// Set the file pointer to the one that we have saved
|
||||
$archive->set_file_pointer( $archive_bytes_offset );
|
||||
|
||||
// Loop over files
|
||||
while ( list( $file_abspath, $file_relpath, $file_size, $file_mtime ) = fgetcsv( $plugins_list ) ) {
|
||||
$file_bytes_written = 0;
|
||||
|
||||
// Add file to archive
|
||||
if ( ( $completed = $archive->add_file( $file_abspath, 'plugins' . DIRECTORY_SEPARATOR . $file_relpath, $file_bytes_written, $file_bytes_offset ) ) ) {
|
||||
$file_bytes_offset = 0;
|
||||
|
||||
// Get plugins bytes offset
|
||||
$plugins_bytes_offset = ftell( $plugins_list );
|
||||
}
|
||||
|
||||
// Increment processed files size
|
||||
$processed_files_size += $file_bytes_written;
|
||||
|
||||
// What percent of files have we processed?
|
||||
$progress = (int) min( ( $processed_files_size / $total_plugins_files_size ) * 100, 100 );
|
||||
|
||||
// Set progress
|
||||
Ai1wm_Status::info( sprintf( __( 'Archiving %d plugin files...<br />%d%% complete', AI1WM_PLUGIN_NAME ), $total_plugins_files_count, $progress ) );
|
||||
|
||||
// More than 10 seconds have passed, break and do another request
|
||||
if ( ( $timeout = apply_filters( 'ai1wm_completed_timeout', 10 ) ) ) {
|
||||
if ( ( microtime( true ) - $start ) > $timeout ) {
|
||||
$completed = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Get archive bytes offset
|
||||
$archive_bytes_offset = $archive->get_file_pointer();
|
||||
|
||||
// Truncate the archive file
|
||||
$archive->truncate();
|
||||
|
||||
// Close the archive file
|
||||
$archive->close();
|
||||
}
|
||||
|
||||
// End of the plugins list?
|
||||
if ( feof( $plugins_list ) ) {
|
||||
|
||||
// Unset archive bytes offset
|
||||
unset( $params['archive_bytes_offset'] );
|
||||
|
||||
// Unset file bytes offset
|
||||
unset( $params['file_bytes_offset'] );
|
||||
|
||||
// Unset plugins bytes offset
|
||||
unset( $params['plugins_bytes_offset'] );
|
||||
|
||||
// Unset processed files size
|
||||
unset( $params['processed_files_size'] );
|
||||
|
||||
// Unset total plugins files size
|
||||
unset( $params['total_plugins_files_size'] );
|
||||
|
||||
// Unset total plugins files count
|
||||
unset( $params['total_plugins_files_count'] );
|
||||
|
||||
// Unset completed flag
|
||||
unset( $params['completed'] );
|
||||
|
||||
} else {
|
||||
|
||||
// Set archive bytes offset
|
||||
$params['archive_bytes_offset'] = $archive_bytes_offset;
|
||||
|
||||
// Set file bytes offset
|
||||
$params['file_bytes_offset'] = $file_bytes_offset;
|
||||
|
||||
// Set plugins bytes offset
|
||||
$params['plugins_bytes_offset'] = $plugins_bytes_offset;
|
||||
|
||||
// Set processed files size
|
||||
$params['processed_files_size'] = $processed_files_size;
|
||||
|
||||
// Set total plugins files size
|
||||
$params['total_plugins_files_size'] = $total_plugins_files_size;
|
||||
|
||||
// Set total plugins files count
|
||||
$params['total_plugins_files_count'] = $total_plugins_files_count;
|
||||
|
||||
// Set completed flag
|
||||
$params['completed'] = $completed;
|
||||
}
|
||||
|
||||
// Close the plugins list file
|
||||
ai1wm_close( $plugins_list );
|
||||
|
||||
return $params;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,193 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2014-2020 ServMask Inc.
|
||||
*
|
||||
* 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/>.
|
||||
*
|
||||
* ███████╗███████╗██████╗ ██╗ ██╗███╗ ███╗ █████╗ ███████╗██╗ ██╗
|
||||
* ██╔════╝██╔════╝██╔══██╗██║ ██║████╗ ████║██╔══██╗██╔════╝██║ ██╔╝
|
||||
* ███████╗█████╗ ██████╔╝██║ ██║██╔████╔██║███████║███████╗█████╔╝
|
||||
* ╚════██║██╔══╝ ██╔══██╗╚██╗ ██╔╝██║╚██╔╝██║██╔══██║╚════██║██╔═██╗
|
||||
* ███████║███████╗██║ ██║ ╚████╔╝ ██║ ╚═╝ ██║██║ ██║███████║██║ ██╗
|
||||
* ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
die( 'Kangaroos cannot jump here' );
|
||||
}
|
||||
|
||||
class Ai1wm_Export_Themes {
|
||||
|
||||
public static function execute( $params ) {
|
||||
|
||||
// Set archive bytes offset
|
||||
if ( isset( $params['archive_bytes_offset'] ) ) {
|
||||
$archive_bytes_offset = (int) $params['archive_bytes_offset'];
|
||||
} else {
|
||||
$archive_bytes_offset = ai1wm_archive_bytes( $params );
|
||||
}
|
||||
|
||||
// Set file bytes offset
|
||||
if ( isset( $params['file_bytes_offset'] ) ) {
|
||||
$file_bytes_offset = (int) $params['file_bytes_offset'];
|
||||
} else {
|
||||
$file_bytes_offset = 0;
|
||||
}
|
||||
|
||||
// Set themes bytes offset
|
||||
if ( isset( $params['themes_bytes_offset'] ) ) {
|
||||
$themes_bytes_offset = (int) $params['themes_bytes_offset'];
|
||||
} else {
|
||||
$themes_bytes_offset = 0;
|
||||
}
|
||||
|
||||
// Get processed files size
|
||||
if ( isset( $params['processed_files_size'] ) ) {
|
||||
$processed_files_size = (int) $params['processed_files_size'];
|
||||
} else {
|
||||
$processed_files_size = 0;
|
||||
}
|
||||
|
||||
// Get total themes files size
|
||||
if ( isset( $params['total_themes_files_size'] ) ) {
|
||||
$total_themes_files_size = (int) $params['total_themes_files_size'];
|
||||
} else {
|
||||
$total_themes_files_size = 1;
|
||||
}
|
||||
|
||||
// Get total themes files count
|
||||
if ( isset( $params['total_themes_files_count'] ) ) {
|
||||
$total_themes_files_count = (int) $params['total_themes_files_count'];
|
||||
} else {
|
||||
$total_themes_files_count = 1;
|
||||
}
|
||||
|
||||
// What percent of files have we processed?
|
||||
$progress = (int) min( ( $processed_files_size / $total_themes_files_size ) * 100, 100 );
|
||||
|
||||
// Set progress
|
||||
Ai1wm_Status::info( sprintf( __( 'Archiving %d theme files...<br />%d%% complete', AI1WM_PLUGIN_NAME ), $total_themes_files_count, $progress ) );
|
||||
|
||||
// Flag to hold if file data has been processed
|
||||
$completed = true;
|
||||
|
||||
// Start time
|
||||
$start = microtime( true );
|
||||
|
||||
// Get themes list file
|
||||
$themes_list = ai1wm_open( ai1wm_themes_list_path( $params ), 'r' );
|
||||
|
||||
// Set the file pointer at the current index
|
||||
if ( fseek( $themes_list, $themes_bytes_offset ) !== -1 ) {
|
||||
|
||||
// Open the archive file for writing
|
||||
$archive = new Ai1wm_Compressor( ai1wm_archive_path( $params ) );
|
||||
|
||||
// Set the file pointer to the one that we have saved
|
||||
$archive->set_file_pointer( $archive_bytes_offset );
|
||||
|
||||
// Loop over files
|
||||
while ( list( $file_abspath, $file_relpath, $file_size, $file_mtime ) = fgetcsv( $themes_list ) ) {
|
||||
$file_bytes_written = 0;
|
||||
|
||||
// Add file to archive
|
||||
if ( ( $completed = $archive->add_file( $file_abspath, 'themes' . DIRECTORY_SEPARATOR . $file_relpath, $file_bytes_written, $file_bytes_offset ) ) ) {
|
||||
$file_bytes_offset = 0;
|
||||
|
||||
// Get themes bytes offset
|
||||
$themes_bytes_offset = ftell( $themes_list );
|
||||
}
|
||||
|
||||
// Increment processed files size
|
||||
$processed_files_size += $file_bytes_written;
|
||||
|
||||
// What percent of files have we processed?
|
||||
$progress = (int) min( ( $processed_files_size / $total_themes_files_size ) * 100, 100 );
|
||||
|
||||
// Set progress
|
||||
Ai1wm_Status::info( sprintf( __( 'Archiving %d theme files...<br />%d%% complete', AI1WM_PLUGIN_NAME ), $total_themes_files_count, $progress ) );
|
||||
|
||||
// More than 10 seconds have passed, break and do another request
|
||||
if ( ( $timeout = apply_filters( 'ai1wm_completed_timeout', 10 ) ) ) {
|
||||
if ( ( microtime( true ) - $start ) > $timeout ) {
|
||||
$completed = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Get archive bytes offset
|
||||
$archive_bytes_offset = $archive->get_file_pointer();
|
||||
|
||||
// Truncate the archive file
|
||||
$archive->truncate();
|
||||
|
||||
// Close the archive file
|
||||
$archive->close();
|
||||
}
|
||||
|
||||
// End of the themes list?
|
||||
if ( feof( $themes_list ) ) {
|
||||
|
||||
// Unset archive bytes offset
|
||||
unset( $params['archive_bytes_offset'] );
|
||||
|
||||
// Unset file bytes offset
|
||||
unset( $params['file_bytes_offset'] );
|
||||
|
||||
// Unset themes bytes offset
|
||||
unset( $params['themes_bytes_offset'] );
|
||||
|
||||
// Unset processed files size
|
||||
unset( $params['processed_files_size'] );
|
||||
|
||||
// Unset total themes files size
|
||||
unset( $params['total_themes_files_size'] );
|
||||
|
||||
// Unset total themes files count
|
||||
unset( $params['total_themes_files_count'] );
|
||||
|
||||
// Unset completed flag
|
||||
unset( $params['completed'] );
|
||||
|
||||
} else {
|
||||
|
||||
// Set archive bytes offset
|
||||
$params['archive_bytes_offset'] = $archive_bytes_offset;
|
||||
|
||||
// Set file bytes offset
|
||||
$params['file_bytes_offset'] = $file_bytes_offset;
|
||||
|
||||
// Set themes bytes offset
|
||||
$params['themes_bytes_offset'] = $themes_bytes_offset;
|
||||
|
||||
// Set processed files size
|
||||
$params['processed_files_size'] = $processed_files_size;
|
||||
|
||||
// Set total themes files size
|
||||
$params['total_themes_files_size'] = $total_themes_files_size;
|
||||
|
||||
// Set total themes files count
|
||||
$params['total_themes_files_count'] = $total_themes_files_count;
|
||||
|
||||
// Set completed flag
|
||||
$params['completed'] = $completed;
|
||||
}
|
||||
|
||||
// Close the themes list file
|
||||
ai1wm_close( $themes_list );
|
||||
|
||||
return $params;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,154 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2014-2020 ServMask Inc.
|
||||
*
|
||||
* 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/>.
|
||||
*
|
||||
* ███████╗███████╗██████╗ ██╗ ██╗███╗ ███╗ █████╗ ███████╗██╗ ██╗
|
||||
* ██╔════╝██╔════╝██╔══██╗██║ ██║████╗ ████║██╔══██╗██╔════╝██║ ██╔╝
|
||||
* ███████╗█████╗ ██████╔╝██║ ██║██╔████╔██║███████║███████╗█████╔╝
|
||||
* ╚════██║██╔══╝ ██╔══██╗╚██╗ ██╔╝██║╚██╔╝██║██╔══██║╚════██║██╔═██╗
|
||||
* ███████║███████╗██║ ██║ ╚████╔╝ ██║ ╚═╝ ██║██║ ██║███████║██║ ██╗
|
||||
* ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
die( 'Kangaroos cannot jump here' );
|
||||
}
|
||||
|
||||
class Ai1wm_Import_Blogs {
|
||||
|
||||
public static function execute( $params ) {
|
||||
|
||||
// Set progress
|
||||
Ai1wm_Status::info( __( 'Preparing blogs...', AI1WM_PLUGIN_NAME ) );
|
||||
|
||||
$blogs = array();
|
||||
|
||||
// Check multisite.json file
|
||||
if ( true === is_file( ai1wm_multisite_path( $params ) ) ) {
|
||||
|
||||
// Read multisite.json file
|
||||
$handle = ai1wm_open( ai1wm_multisite_path( $params ), 'r' );
|
||||
|
||||
// Parse multisite.json file
|
||||
$multisite = ai1wm_read( $handle, filesize( ai1wm_multisite_path( $params ) ) );
|
||||
$multisite = json_decode( $multisite, true );
|
||||
|
||||
// Close handle
|
||||
ai1wm_close( $handle );
|
||||
|
||||
// Validate
|
||||
if ( empty( $multisite['Network'] ) ) {
|
||||
if ( isset( $multisite['Sites'] ) && ( $sites = $multisite['Sites'] ) ) {
|
||||
if ( count( $sites ) === 1 && ( $subsite = current( $sites ) ) ) {
|
||||
|
||||
// Set internal Site URL (backward compatibility)
|
||||
if ( empty( $subsite['InternalSiteURL'] ) ) {
|
||||
$subsite['InternalSiteURL'] = null;
|
||||
}
|
||||
|
||||
// Set internal Home URL (backward compatibility)
|
||||
if ( empty( $subsite['InternalHomeURL'] ) ) {
|
||||
$subsite['InternalHomeURL'] = null;
|
||||
}
|
||||
|
||||
// Set active plugins (backward compatibility)
|
||||
if ( empty( $subsite['Plugins'] ) ) {
|
||||
$subsite['Plugins'] = array();
|
||||
}
|
||||
|
||||
// Set active template (backward compatibility)
|
||||
if ( empty( $subsite['Template'] ) ) {
|
||||
$subsite['Template'] = null;
|
||||
}
|
||||
|
||||
// Set active stylesheet (backward compatibility)
|
||||
if ( empty( $subsite['Stylesheet'] ) ) {
|
||||
$subsite['Stylesheet'] = null;
|
||||
}
|
||||
|
||||
// Set uploads path (backward compatibility)
|
||||
if ( empty( $subsite['Uploads'] ) ) {
|
||||
$subsite['Uploads'] = null;
|
||||
}
|
||||
|
||||
// Set uploads URL path (backward compatibility)
|
||||
if ( empty( $subsite['UploadsURL'] ) ) {
|
||||
$subsite['UploadsURL'] = null;
|
||||
}
|
||||
|
||||
// Set uploads path (backward compatibility)
|
||||
if ( empty( $subsite['WordPress']['Uploads'] ) ) {
|
||||
$subsite['WordPress']['Uploads'] = null;
|
||||
}
|
||||
|
||||
// Set uploads URL path (backward compatibility)
|
||||
if ( empty( $subsite['WordPress']['UploadsURL'] ) ) {
|
||||
$subsite['WordPress']['UploadsURL'] = null;
|
||||
}
|
||||
|
||||
// Set blog items
|
||||
$blogs[] = array(
|
||||
'Old' => array(
|
||||
'BlogID' => $subsite['BlogID'],
|
||||
'SiteURL' => $subsite['SiteURL'],
|
||||
'HomeURL' => $subsite['HomeURL'],
|
||||
'InternalSiteURL' => $subsite['InternalSiteURL'],
|
||||
'InternalHomeURL' => $subsite['InternalHomeURL'],
|
||||
'Plugins' => $subsite['Plugins'],
|
||||
'Template' => $subsite['Template'],
|
||||
'Stylesheet' => $subsite['Stylesheet'],
|
||||
'Uploads' => $subsite['Uploads'],
|
||||
'UploadsURL' => $subsite['UploadsURL'],
|
||||
'WordPress' => $subsite['WordPress'],
|
||||
),
|
||||
'New' => array(
|
||||
'BlogID' => null,
|
||||
'SiteURL' => site_url(),
|
||||
'HomeURL' => home_url(),
|
||||
'InternalSiteURL' => site_url(),
|
||||
'InternalHomeURL' => home_url(),
|
||||
'Plugins' => $subsite['Plugins'],
|
||||
'Template' => $subsite['Template'],
|
||||
'Stylesheet' => $subsite['Stylesheet'],
|
||||
'Uploads' => get_option( 'upload_path' ),
|
||||
'UploadsURL' => get_option( 'upload_url_path' ),
|
||||
'WordPress' => array(
|
||||
'UploadsURL' => ai1wm_get_uploads_url(),
|
||||
),
|
||||
),
|
||||
);
|
||||
} else {
|
||||
throw new Ai1wm_Import_Exception( __( 'The archive should contain <strong>Single WordPress</strong> site! Please revisit your export settings.', AI1WM_PLUGIN_NAME ) );
|
||||
}
|
||||
} else {
|
||||
throw new Ai1wm_Import_Exception( __( 'At least <strong>one WordPress</strong> site should be presented in the archive.', AI1WM_PLUGIN_NAME ) );
|
||||
}
|
||||
} else {
|
||||
throw new Ai1wm_Import_Exception( __( 'Unable to import <strong>WordPress Network</strong> into WordPress <strong>Single</strong> site.', AI1WM_PLUGIN_NAME ) );
|
||||
}
|
||||
}
|
||||
|
||||
// Write blogs.json file
|
||||
$handle = ai1wm_open( ai1wm_blogs_path( $params ), 'w' );
|
||||
ai1wm_write( $handle, json_encode( $blogs ) );
|
||||
ai1wm_close( $handle );
|
||||
|
||||
// Set progress
|
||||
Ai1wm_Status::info( __( 'Done preparing blogs.', AI1WM_PLUGIN_NAME ) );
|
||||
|
||||
return $params;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2014-2020 ServMask Inc.
|
||||
*
|
||||
* 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/>.
|
||||
*
|
||||
* ███████╗███████╗██████╗ ██╗ ██╗███╗ ███╗ █████╗ ███████╗██╗ ██╗
|
||||
* ██╔════╝██╔════╝██╔══██╗██║ ██║████╗ ████║██╔══██╗██╔════╝██║ ██╔╝
|
||||
* ███████╗█████╗ ██████╔╝██║ ██║██╔████╔██║███████║███████╗█████╔╝
|
||||
* ╚════██║██╔══╝ ██╔══██╗╚██╗ ██╔╝██║╚██╔╝██║██╔══██║╚════██║██╔═██╗
|
||||
* ███████║███████╗██║ ██║ ╚████╔╝ ██║ ╚═╝ ██║██║ ██║███████║██║ ██╗
|
||||
* ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
die( 'Kangaroos cannot jump here' );
|
||||
}
|
||||
|
||||
class Ai1wm_Import_Clean {
|
||||
|
||||
public static function execute( $params ) {
|
||||
global $wpdb;
|
||||
|
||||
// Get database client
|
||||
if ( empty( $wpdb->use_mysqli ) ) {
|
||||
$mysql = new Ai1wm_Database_Mysql( $wpdb );
|
||||
} else {
|
||||
$mysql = new Ai1wm_Database_Mysqli( $wpdb );
|
||||
}
|
||||
|
||||
// Flush mainsite tables
|
||||
$mysql->add_table_prefix_filter( ai1wm_table_prefix( 'mainsite' ) );
|
||||
$mysql->flush();
|
||||
|
||||
// Delete storage files
|
||||
Ai1wm_Directory::delete( ai1wm_storage_path( $params ) );
|
||||
|
||||
// Exit in console
|
||||
if ( defined( 'WP_CLI' ) ) {
|
||||
return $params;
|
||||
}
|
||||
|
||||
exit;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2014-2020 ServMask Inc.
|
||||
*
|
||||
* 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/>.
|
||||
*
|
||||
* ███████╗███████╗██████╗ ██╗ ██╗███╗ ███╗ █████╗ ███████╗██╗ ██╗
|
||||
* ██╔════╝██╔════╝██╔══██╗██║ ██║████╗ ████║██╔══██╗██╔════╝██║ ██╔╝
|
||||
* ███████╗█████╗ ██████╔╝██║ ██║██╔████╔██║███████║███████╗█████╔╝
|
||||
* ╚════██║██╔══╝ ██╔══██╗╚██╗ ██╔╝██║╚██╔╝██║██╔══██║╚════██║██╔═██╗
|
||||
* ███████║███████╗██║ ██║ ╚████╔╝ ██║ ╚═╝ ██║██║ ██║███████║██║ ██╗
|
||||
* ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
die( 'Kangaroos cannot jump here' );
|
||||
}
|
||||
|
||||
class Ai1wm_Import_Compatibility {
|
||||
|
||||
public static function execute( $params ) {
|
||||
|
||||
// Set progress
|
||||
Ai1wm_Status::info( __( 'Checking extensions compatibility...', AI1WM_PLUGIN_NAME ) );
|
||||
|
||||
// Get messages
|
||||
$messages = Ai1wm_Compatibility::get( $params );
|
||||
|
||||
// Set messages
|
||||
if ( empty( $messages ) ) {
|
||||
return $params;
|
||||
}
|
||||
|
||||
// Error message
|
||||
throw new Ai1wm_Compatibility_Exception( implode( $messages ) );
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,95 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2014-2020 ServMask Inc.
|
||||
*
|
||||
* 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/>.
|
||||
*
|
||||
* ███████╗███████╗██████╗ ██╗ ██╗███╗ ███╗ █████╗ ███████╗██╗ ██╗
|
||||
* ██╔════╝██╔════╝██╔══██╗██║ ██║████╗ ████║██╔══██╗██╔════╝██║ ██╔╝
|
||||
* ███████╗█████╗ ██████╔╝██║ ██║██╔████╔██║███████║███████╗█████╔╝
|
||||
* ╚════██║██╔══╝ ██╔══██╗╚██╗ ██╔╝██║╚██╔╝██║██╔══██║╚════██║██╔═██╗
|
||||
* ███████║███████╗██║ ██║ ╚████╔╝ ██║ ╚═╝ ██║██║ ██║███████║██║ ██╗
|
||||
* ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
die( 'Kangaroos cannot jump here' );
|
||||
}
|
||||
|
||||
class Ai1wm_Import_Confirm {
|
||||
|
||||
public static function execute( $params ) {
|
||||
|
||||
$messages = array();
|
||||
|
||||
// Read package.json file
|
||||
$handle = ai1wm_open( ai1wm_package_path( $params ), 'r' );
|
||||
|
||||
// Parse package.json file
|
||||
$package = ai1wm_read( $handle, filesize( ai1wm_package_path( $params ) ) );
|
||||
$package = json_decode( $package, true );
|
||||
|
||||
// Close handle
|
||||
ai1wm_close( $handle );
|
||||
|
||||
// Confirm message
|
||||
if ( defined( 'WP_CLI' ) ) {
|
||||
$messages[] = __(
|
||||
'The import process will overwrite your website including the database, media, plugins, and themes. ' .
|
||||
'Are you sure to proceed?',
|
||||
AI1WM_PLUGIN_NAME
|
||||
);
|
||||
} else {
|
||||
$messages[] = __(
|
||||
'The import process will overwrite your website including the database, media, plugins, and themes. ' .
|
||||
'Please ensure that you have a backup of your data before proceeding to the next step.',
|
||||
AI1WM_PLUGIN_NAME
|
||||
);
|
||||
}
|
||||
|
||||
// Check compatibility of PHP versions
|
||||
if ( isset( $package['PHP']['Version'] ) ) {
|
||||
if ( version_compare( $package['PHP']['Version'], '7.0.0', '<' ) && version_compare( PHP_VERSION, '7.0.0', '>=' ) ) {
|
||||
if ( defined( 'WP_CLI' ) ) {
|
||||
$messages[] = __(
|
||||
'Your backup is from a PHP 5 but the site that you are importing to is PHP 7. ' .
|
||||
'This could cause the import to fail. Technical details: https://help.servmask.com/knowledgebase/migrate-wordpress-from-php-5-to-php-7/',
|
||||
AI1WM_PLUGIN_NAME
|
||||
);
|
||||
} else {
|
||||
$messages[] = __(
|
||||
'<i class="ai1wm-import-info">Your backup is from a PHP 5 but the site that you are importing to is PHP 7. ' .
|
||||
'This could cause the import to fail. <a href="https://help.servmask.com/knowledgebase/migrate-wordpress-from-php-5-to-php-7/" target="_blank">Technical details</a></i>',
|
||||
AI1WM_PLUGIN_NAME
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( defined( 'WP_CLI' ) ) {
|
||||
$assoc_args = array();
|
||||
if ( isset( $params['cli_args'] ) ) {
|
||||
$assoc_args = $params['cli_args'];
|
||||
}
|
||||
|
||||
WP_CLI::confirm( implode( $messages ), $assoc_args );
|
||||
|
||||
return $params;
|
||||
}
|
||||
|
||||
// Set progress
|
||||
Ai1wm_Status::confirm( implode( $messages ) );
|
||||
exit;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,264 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2014-2020 ServMask Inc.
|
||||
*
|
||||
* 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/>.
|
||||
*
|
||||
* ███████╗███████╗██████╗ ██╗ ██╗███╗ ███╗ █████╗ ███████╗██╗ ██╗
|
||||
* ██╔════╝██╔════╝██╔══██╗██║ ██║████╗ ████║██╔══██╗██╔════╝██║ ██╔╝
|
||||
* ███████╗█████╗ ██████╔╝██║ ██║██╔████╔██║███████║███████╗█████╔╝
|
||||
* ╚════██║██╔══╝ ██╔══██╗╚██╗ ██╔╝██║╚██╔╝██║██╔══██║╚════██║██╔═██╗
|
||||
* ███████║███████╗██║ ██║ ╚████╔╝ ██║ ╚═╝ ██║██║ ██║███████║██║ ██╗
|
||||
* ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
die( 'Kangaroos cannot jump here' );
|
||||
}
|
||||
|
||||
class Ai1wm_Import_Content {
|
||||
|
||||
public static function execute( $params ) {
|
||||
|
||||
// Set archive bytes offset
|
||||
if ( isset( $params['archive_bytes_offset'] ) ) {
|
||||
$archive_bytes_offset = (int) $params['archive_bytes_offset'];
|
||||
} else {
|
||||
$archive_bytes_offset = 0;
|
||||
}
|
||||
|
||||
// Set file bytes offset
|
||||
if ( isset( $params['file_bytes_offset'] ) ) {
|
||||
$file_bytes_offset = (int) $params['file_bytes_offset'];
|
||||
} else {
|
||||
$file_bytes_offset = 0;
|
||||
}
|
||||
|
||||
// Get processed files size
|
||||
if ( isset( $params['processed_files_size'] ) ) {
|
||||
$processed_files_size = (int) $params['processed_files_size'];
|
||||
} else {
|
||||
$processed_files_size = 0;
|
||||
}
|
||||
|
||||
// Get total files size
|
||||
if ( isset( $params['total_files_size'] ) ) {
|
||||
$total_files_size = (int) $params['total_files_size'];
|
||||
} else {
|
||||
$total_files_size = 1;
|
||||
}
|
||||
|
||||
// Get total files count
|
||||
if ( isset( $params['total_files_count'] ) ) {
|
||||
$total_files_count = (int) $params['total_files_count'];
|
||||
} else {
|
||||
$total_files_count = 1;
|
||||
}
|
||||
|
||||
// Read blogs.json file
|
||||
$handle = ai1wm_open( ai1wm_blogs_path( $params ), 'r' );
|
||||
|
||||
// Parse blogs.json file
|
||||
$blogs = ai1wm_read( $handle, filesize( ai1wm_blogs_path( $params ) ) );
|
||||
$blogs = json_decode( $blogs, true );
|
||||
|
||||
// Close handle
|
||||
ai1wm_close( $handle );
|
||||
|
||||
// What percent of files have we processed?
|
||||
$progress = (int) min( ( $processed_files_size / $total_files_size ) * 100, 100 );
|
||||
|
||||
// Set progress
|
||||
Ai1wm_Status::info( sprintf( __( 'Restoring %d files...<br />%d%% complete', AI1WM_PLUGIN_NAME ), $total_files_count, $progress ) );
|
||||
|
||||
// Flag to hold if file data has been processed
|
||||
$completed = true;
|
||||
|
||||
// Start time
|
||||
$start = microtime( true );
|
||||
|
||||
// Open the archive file for reading
|
||||
$archive = new Ai1wm_Extractor( ai1wm_archive_path( $params ) );
|
||||
|
||||
// Set the file pointer to the one that we have saved
|
||||
$archive->set_file_pointer( $archive_bytes_offset );
|
||||
|
||||
$old_paths = array( 'plugins', 'themes' );
|
||||
$new_paths = array( ai1wm_get_plugins_dir(), get_theme_root() );
|
||||
|
||||
// Set extract paths
|
||||
foreach ( $blogs as $blog ) {
|
||||
if ( ai1wm_is_mainsite( $blog['Old']['BlogID'] ) === false ) {
|
||||
if ( defined( 'UPLOADBLOGSDIR' ) ) {
|
||||
// Old files dir style
|
||||
$old_paths[] = ai1wm_blog_files_relpath( $blog['Old']['BlogID'] );
|
||||
$new_paths[] = ai1wm_blog_files_abspath( $blog['New']['BlogID'] );
|
||||
|
||||
// Old blogs.dir style
|
||||
$old_paths[] = ai1wm_blog_blogsdir_relpath( $blog['Old']['BlogID'] );
|
||||
$new_paths[] = ai1wm_blog_blogsdir_abspath( $blog['New']['BlogID'] );
|
||||
|
||||
// New sites dir style
|
||||
$old_paths[] = ai1wm_blog_sites_relpath( $blog['Old']['BlogID'] );
|
||||
$new_paths[] = ai1wm_blog_files_abspath( $blog['New']['BlogID'] );
|
||||
} else {
|
||||
// Old files dir style
|
||||
$old_paths[] = ai1wm_blog_files_relpath( $blog['Old']['BlogID'] );
|
||||
$new_paths[] = ai1wm_blog_sites_abspath( $blog['New']['BlogID'] );
|
||||
|
||||
// Old blogs.dir style
|
||||
$old_paths[] = ai1wm_blog_blogsdir_relpath( $blog['Old']['BlogID'] );
|
||||
$new_paths[] = ai1wm_blog_sites_abspath( $blog['New']['BlogID'] );
|
||||
|
||||
// New sites dir style
|
||||
$old_paths[] = ai1wm_blog_sites_relpath( $blog['Old']['BlogID'] );
|
||||
$new_paths[] = ai1wm_blog_sites_abspath( $blog['New']['BlogID'] );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Set base site extract paths (should be added at the end of arrays)
|
||||
foreach ( $blogs as $blog ) {
|
||||
if ( ai1wm_is_mainsite( $blog['Old']['BlogID'] ) === true ) {
|
||||
if ( defined( 'UPLOADBLOGSDIR' ) ) {
|
||||
// Old files dir style
|
||||
$old_paths[] = ai1wm_blog_files_relpath( $blog['Old']['BlogID'] );
|
||||
$new_paths[] = ai1wm_blog_files_abspath( $blog['New']['BlogID'] );
|
||||
|
||||
// Old blogs.dir style
|
||||
$old_paths[] = ai1wm_blog_blogsdir_relpath( $blog['Old']['BlogID'] );
|
||||
$new_paths[] = ai1wm_blog_blogsdir_abspath( $blog['New']['BlogID'] );
|
||||
|
||||
// New sites dir style
|
||||
$old_paths[] = ai1wm_blog_sites_relpath( $blog['Old']['BlogID'] );
|
||||
$new_paths[] = ai1wm_blog_files_abspath( $blog['New']['BlogID'] );
|
||||
} else {
|
||||
// Old files dir style
|
||||
$old_paths[] = ai1wm_blog_files_relpath( $blog['Old']['BlogID'] );
|
||||
$new_paths[] = ai1wm_blog_sites_abspath( $blog['New']['BlogID'] );
|
||||
|
||||
// Old blogs.dir style
|
||||
$old_paths[] = ai1wm_blog_blogsdir_relpath( $blog['Old']['BlogID'] );
|
||||
$new_paths[] = ai1wm_blog_sites_abspath( $blog['New']['BlogID'] );
|
||||
|
||||
// New sites dir style
|
||||
$old_paths[] = ai1wm_blog_sites_relpath( $blog['Old']['BlogID'] );
|
||||
$new_paths[] = ai1wm_blog_sites_abspath( $blog['New']['BlogID'] );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$old_paths[] = ai1wm_blog_sites_relpath();
|
||||
$new_paths[] = ai1wm_blog_sites_abspath();
|
||||
|
||||
while ( $archive->has_not_reached_eof() ) {
|
||||
$file_bytes_written = 0;
|
||||
|
||||
// Exclude WordPress files
|
||||
$exclude_files = array_keys( _get_dropins() );
|
||||
|
||||
// Exclude plugin files
|
||||
$exclude_files = array_merge(
|
||||
$exclude_files,
|
||||
array(
|
||||
AI1WM_PACKAGE_NAME,
|
||||
AI1WM_MULTISITE_NAME,
|
||||
AI1WM_DATABASE_NAME,
|
||||
AI1WM_MUPLUGINS_NAME,
|
||||
)
|
||||
);
|
||||
|
||||
// Exclude theme files
|
||||
$exclude_files = array_merge( $exclude_files, array( AI1WM_THEMES_FUNCTIONS_NAME ) );
|
||||
|
||||
// Exclude Elementor files
|
||||
$exclude_files = array_merge( $exclude_files, array( AI1WM_ELEMENTOR_CSS_NAME ) );
|
||||
|
||||
// Exclude content extensions
|
||||
$exclude_extensions = array( AI1WM_LESS_CACHE_NAME );
|
||||
|
||||
// Extract a file from archive to WP_CONTENT_DIR
|
||||
if ( ( $completed = $archive->extract_one_file_to( WP_CONTENT_DIR, $exclude_files, $exclude_extensions, $old_paths, $new_paths, $file_bytes_written, $file_bytes_offset ) ) ) {
|
||||
$file_bytes_offset = 0;
|
||||
}
|
||||
|
||||
// Get archive bytes offset
|
||||
$archive_bytes_offset = $archive->get_file_pointer();
|
||||
|
||||
// Increment processed files size
|
||||
$processed_files_size += $file_bytes_written;
|
||||
|
||||
// What percent of files have we processed?
|
||||
$progress = (int) min( ( $processed_files_size / $total_files_size ) * 100, 100 );
|
||||
|
||||
// Set progress
|
||||
Ai1wm_Status::info( sprintf( __( 'Restoring %d files...<br />%d%% complete', AI1WM_PLUGIN_NAME ), $total_files_count, $progress ) );
|
||||
|
||||
// More than 10 seconds have passed, break and do another request
|
||||
if ( ( $timeout = apply_filters( 'ai1wm_completed_timeout', 10 ) ) ) {
|
||||
if ( ( microtime( true ) - $start ) > $timeout ) {
|
||||
$completed = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// End of the archive?
|
||||
if ( $archive->has_reached_eof() ) {
|
||||
|
||||
// Unset archive bytes offset
|
||||
unset( $params['archive_bytes_offset'] );
|
||||
|
||||
// Unset file bytes offset
|
||||
unset( $params['file_bytes_offset'] );
|
||||
|
||||
// Unset processed files size
|
||||
unset( $params['processed_files_size'] );
|
||||
|
||||
// Unset total files size
|
||||
unset( $params['total_files_size'] );
|
||||
|
||||
// Unset total files count
|
||||
unset( $params['total_files_count'] );
|
||||
|
||||
// Unset completed flag
|
||||
unset( $params['completed'] );
|
||||
|
||||
} else {
|
||||
|
||||
// Set archive bytes offset
|
||||
$params['archive_bytes_offset'] = $archive_bytes_offset;
|
||||
|
||||
// Set file bytes offset
|
||||
$params['file_bytes_offset'] = $file_bytes_offset;
|
||||
|
||||
// Set processed files size
|
||||
$params['processed_files_size'] = $processed_files_size;
|
||||
|
||||
// Set total files size
|
||||
$params['total_files_size'] = $total_files_size;
|
||||
|
||||
// Set total files count
|
||||
$params['total_files_count'] = $total_files_count;
|
||||
|
||||
// Set completed flag
|
||||
$params['completed'] = $completed;
|
||||
}
|
||||
|
||||
// Close the archive file
|
||||
$archive->close();
|
||||
|
||||
return $params;
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,369 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2014-2020 ServMask Inc.
|
||||
*
|
||||
* 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/>.
|
||||
*
|
||||
* ███████╗███████╗██████╗ ██╗ ██╗███╗ ███╗ █████╗ ███████╗██╗ ██╗
|
||||
* ██╔════╝██╔════╝██╔══██╗██║ ██║████╗ ████║██╔══██╗██╔════╝██║ ██╔╝
|
||||
* ███████╗█████╗ ██████╔╝██║ ██║██╔████╔██║███████║███████╗█████╔╝
|
||||
* ╚════██║██╔══╝ ██╔══██╗╚██╗ ██╔╝██║╚██╔╝██║██╔══██║╚════██║██╔═██╗
|
||||
* ███████║███████╗██║ ██║ ╚████╔╝ ██║ ╚═╝ ██║██║ ██║███████║██║ ██╗
|
||||
* ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
die( 'Kangaroos cannot jump here' );
|
||||
}
|
||||
|
||||
class Ai1wm_Import_Done {
|
||||
|
||||
public static function execute( $params ) {
|
||||
global $wp_rewrite;
|
||||
|
||||
// Check multisite.json file
|
||||
if ( is_file( ai1wm_multisite_path( $params ) ) ) {
|
||||
|
||||
// Read multisite.json file
|
||||
$handle = ai1wm_open( ai1wm_multisite_path( $params ), 'r' );
|
||||
|
||||
// Parse multisite.json file
|
||||
$multisite = ai1wm_read( $handle, filesize( ai1wm_multisite_path( $params ) ) );
|
||||
$multisite = json_decode( $multisite, true );
|
||||
|
||||
// Close handle
|
||||
ai1wm_close( $handle );
|
||||
|
||||
// Activate WordPress plugins
|
||||
if ( isset( $multisite['Plugins'] ) && ( $plugins = $multisite['Plugins'] ) ) {
|
||||
ai1wm_activate_plugins( $plugins );
|
||||
}
|
||||
|
||||
// Deactivate WordPress SSL plugins
|
||||
if ( ! is_ssl() ) {
|
||||
ai1wm_deactivate_plugins(
|
||||
array(
|
||||
ai1wm_discover_plugin_basename( 'really-simple-ssl/rlrsssl-really-simple-ssl.php' ),
|
||||
ai1wm_discover_plugin_basename( 'wordpress-https/wordpress-https.php' ),
|
||||
ai1wm_discover_plugin_basename( 'wp-force-ssl/wp-force-ssl.php' ),
|
||||
ai1wm_discover_plugin_basename( 'force-https-littlebizzy/force-https.php' ),
|
||||
)
|
||||
);
|
||||
|
||||
ai1wm_woocommerce_force_ssl( false );
|
||||
}
|
||||
|
||||
// Deactivate WordPress plugins
|
||||
ai1wm_deactivate_plugins(
|
||||
array(
|
||||
ai1wm_discover_plugin_basename( 'invisible-recaptcha/invisible-recaptcha.php' ),
|
||||
ai1wm_discover_plugin_basename( 'wps-hide-login/wps-hide-login.php' ),
|
||||
ai1wm_discover_plugin_basename( 'hide-my-wp/index.php' ),
|
||||
ai1wm_discover_plugin_basename( 'hide-my-wordpress/index.php' ),
|
||||
ai1wm_discover_plugin_basename( 'mycustomwidget/my_custom_widget.php' ),
|
||||
ai1wm_discover_plugin_basename( 'lockdown-wp-admin/lockdown-wp-admin.php' ),
|
||||
ai1wm_discover_plugin_basename( 'rename-wp-login/rename-wp-login.php' ),
|
||||
ai1wm_discover_plugin_basename( 'wp-simple-firewall/icwp-wpsf.php' ),
|
||||
ai1wm_discover_plugin_basename( 'join-my-multisite/joinmymultisite.php' ),
|
||||
ai1wm_discover_plugin_basename( 'multisite-clone-duplicator/multisite-clone-duplicator.php' ),
|
||||
ai1wm_discover_plugin_basename( 'wordpress-mu-domain-mapping/domain_mapping.php' ),
|
||||
ai1wm_discover_plugin_basename( 'wordpress-starter/siteground-wizard.php' ),
|
||||
ai1wm_discover_plugin_basename( 'pro-sites/pro-sites.php' ),
|
||||
ai1wm_discover_plugin_basename( 'wpide/WPide.php' ),
|
||||
ai1wm_discover_plugin_basename( 'page-optimize/page-optimize.php' ),
|
||||
)
|
||||
);
|
||||
|
||||
// Deactivate Swift Optimizer rules
|
||||
ai1wm_deactivate_swift_optimizer_rules(
|
||||
array(
|
||||
ai1wm_discover_plugin_basename( 'all-in-one-wp-migration/all-in-one-wp-migration.php' ),
|
||||
ai1wm_discover_plugin_basename( 'all-in-one-wp-migration-azure-storage-extension/all-in-one-wp-migration-azure-storage-extension.php' ),
|
||||
ai1wm_discover_plugin_basename( 'all-in-one-wp-migration-b2-extension/all-in-one-wp-migration-b2-extension.php' ),
|
||||
ai1wm_discover_plugin_basename( 'all-in-one-wp-migration-backup/all-in-one-wp-migration-backup.php' ),
|
||||
ai1wm_discover_plugin_basename( 'all-in-one-wp-migration-box-extension/all-in-one-wp-migration-box-extension.php' ),
|
||||
ai1wm_discover_plugin_basename( 'all-in-one-wp-migration-digitalocean-extension/all-in-one-wp-migration-digitalocean-extension.php' ),
|
||||
ai1wm_discover_plugin_basename( 'all-in-one-wp-migration-direct-extension/all-in-one-wp-migration-direct-extension.php' ),
|
||||
ai1wm_discover_plugin_basename( 'all-in-one-wp-migration-dropbox-extension/all-in-one-wp-migration-dropbox-extension.php' ),
|
||||
ai1wm_discover_plugin_basename( 'all-in-one-wp-migration-file-extension/all-in-one-wp-migration-file-extension.php' ),
|
||||
ai1wm_discover_plugin_basename( 'all-in-one-wp-migration-ftp-extension/all-in-one-wp-migration-ftp-extension.php' ),
|
||||
ai1wm_discover_plugin_basename( 'all-in-one-wp-migration-gcloud-storage-extension/all-in-one-wp-migration-gcloud-storage-extension.php' ),
|
||||
ai1wm_discover_plugin_basename( 'all-in-one-wp-migration-gdrive-extension/all-in-one-wp-migration-gdrive-extension.php' ),
|
||||
ai1wm_discover_plugin_basename( 'all-in-one-wp-migration-glacier-extension/all-in-one-wp-migration-glacier-extension.php' ),
|
||||
ai1wm_discover_plugin_basename( 'all-in-one-wp-migration-mega-extension/all-in-one-wp-migration-mega-extension.php' ),
|
||||
ai1wm_discover_plugin_basename( 'all-in-one-wp-migration-multisite-extension/all-in-one-wp-migration-multisite-extension.php' ),
|
||||
ai1wm_discover_plugin_basename( 'all-in-one-wp-migration-onedrive-extension/all-in-one-wp-migration-onedrive-extension.php' ),
|
||||
ai1wm_discover_plugin_basename( 'all-in-one-wp-migration-pcloud-extension/all-in-one-wp-migration-pcloud-extension.php' ),
|
||||
ai1wm_discover_plugin_basename( 'all-in-one-wp-migration-pro/all-in-one-wp-migration-pro.php' ),
|
||||
ai1wm_discover_plugin_basename( 'all-in-one-wp-migration-s3-client-extension/all-in-one-wp-migration-s3-client-extension.php' ),
|
||||
ai1wm_discover_plugin_basename( 'all-in-one-wp-migration-s3-extension/all-in-one-wp-migration-s3-extension.php' ),
|
||||
ai1wm_discover_plugin_basename( 'all-in-one-wp-migration-unlimited-extension/all-in-one-wp-migration-unlimited-extension.php' ),
|
||||
ai1wm_discover_plugin_basename( 'all-in-one-wp-migration-url-extension/all-in-one-wp-migration-url-extension.php' ),
|
||||
ai1wm_discover_plugin_basename( 'all-in-one-wp-migration-webdav-extension/all-in-one-wp-migration-webdav-extension.php' ),
|
||||
)
|
||||
);
|
||||
|
||||
// Deactivate Revolution Slider
|
||||
ai1wm_deactivate_revolution_slider( ai1wm_discover_plugin_basename( 'revslider/revslider.php' ) );
|
||||
|
||||
// Deactivate Jetpack modules
|
||||
ai1wm_deactivate_jetpack_modules( array( 'photon', 'sso' ) );
|
||||
|
||||
// Flush Elementor cache
|
||||
ai1wm_elementor_cache_flush();
|
||||
|
||||
// Initial DB version
|
||||
ai1wm_initial_db_version();
|
||||
|
||||
} else {
|
||||
|
||||
// Check package.json file
|
||||
if ( is_file( ai1wm_package_path( $params ) ) ) {
|
||||
|
||||
// Read package.json file
|
||||
$handle = ai1wm_open( ai1wm_package_path( $params ), 'r' );
|
||||
|
||||
// Parse package.json file
|
||||
$package = ai1wm_read( $handle, filesize( ai1wm_package_path( $params ) ) );
|
||||
$package = json_decode( $package, true );
|
||||
|
||||
// Close handle
|
||||
ai1wm_close( $handle );
|
||||
|
||||
// Activate WordPress plugins
|
||||
if ( isset( $package['Plugins'] ) && ( $plugins = $package['Plugins'] ) ) {
|
||||
ai1wm_activate_plugins( $plugins );
|
||||
}
|
||||
|
||||
// Activate WordPress template
|
||||
if ( isset( $package['Template'] ) && ( $template = $package['Template'] ) ) {
|
||||
ai1wm_activate_template( $template );
|
||||
}
|
||||
|
||||
// Activate WordPress stylesheet
|
||||
if ( isset( $package['Stylesheet'] ) && ( $stylesheet = $package['Stylesheet'] ) ) {
|
||||
ai1wm_activate_stylesheet( $stylesheet );
|
||||
}
|
||||
|
||||
// Deactivate WordPress SSL plugins
|
||||
if ( ! is_ssl() ) {
|
||||
ai1wm_deactivate_plugins(
|
||||
array(
|
||||
ai1wm_discover_plugin_basename( 'really-simple-ssl/rlrsssl-really-simple-ssl.php' ),
|
||||
ai1wm_discover_plugin_basename( 'wordpress-https/wordpress-https.php' ),
|
||||
ai1wm_discover_plugin_basename( 'wp-force-ssl/wp-force-ssl.php' ),
|
||||
ai1wm_discover_plugin_basename( 'force-https-littlebizzy/force-https.php' ),
|
||||
)
|
||||
);
|
||||
|
||||
ai1wm_woocommerce_force_ssl( false );
|
||||
}
|
||||
|
||||
// Deactivate WordPress plugins
|
||||
ai1wm_deactivate_plugins(
|
||||
array(
|
||||
ai1wm_discover_plugin_basename( 'invisible-recaptcha/invisible-recaptcha.php' ),
|
||||
ai1wm_discover_plugin_basename( 'wps-hide-login/wps-hide-login.php' ),
|
||||
ai1wm_discover_plugin_basename( 'hide-my-wp/index.php' ),
|
||||
ai1wm_discover_plugin_basename( 'hide-my-wordpress/index.php' ),
|
||||
ai1wm_discover_plugin_basename( 'mycustomwidget/my_custom_widget.php' ),
|
||||
ai1wm_discover_plugin_basename( 'lockdown-wp-admin/lockdown-wp-admin.php' ),
|
||||
ai1wm_discover_plugin_basename( 'rename-wp-login/rename-wp-login.php' ),
|
||||
ai1wm_discover_plugin_basename( 'wp-simple-firewall/icwp-wpsf.php' ),
|
||||
ai1wm_discover_plugin_basename( 'join-my-multisite/joinmymultisite.php' ),
|
||||
ai1wm_discover_plugin_basename( 'multisite-clone-duplicator/multisite-clone-duplicator.php' ),
|
||||
ai1wm_discover_plugin_basename( 'wordpress-mu-domain-mapping/domain_mapping.php' ),
|
||||
ai1wm_discover_plugin_basename( 'wordpress-starter/siteground-wizard.php' ),
|
||||
ai1wm_discover_plugin_basename( 'pro-sites/pro-sites.php' ),
|
||||
ai1wm_discover_plugin_basename( 'wpide/WPide.php' ),
|
||||
ai1wm_discover_plugin_basename( 'page-optimize/page-optimize.php' ),
|
||||
)
|
||||
);
|
||||
|
||||
// Deactivate Swift Optimizer rules
|
||||
ai1wm_deactivate_swift_optimizer_rules(
|
||||
array(
|
||||
ai1wm_discover_plugin_basename( 'all-in-one-wp-migration/all-in-one-wp-migration.php' ),
|
||||
ai1wm_discover_plugin_basename( 'all-in-one-wp-migration-azure-storage-extension/all-in-one-wp-migration-azure-storage-extension.php' ),
|
||||
ai1wm_discover_plugin_basename( 'all-in-one-wp-migration-b2-extension/all-in-one-wp-migration-b2-extension.php' ),
|
||||
ai1wm_discover_plugin_basename( 'all-in-one-wp-migration-backup/all-in-one-wp-migration-backup.php' ),
|
||||
ai1wm_discover_plugin_basename( 'all-in-one-wp-migration-box-extension/all-in-one-wp-migration-box-extension.php' ),
|
||||
ai1wm_discover_plugin_basename( 'all-in-one-wp-migration-digitalocean-extension/all-in-one-wp-migration-digitalocean-extension.php' ),
|
||||
ai1wm_discover_plugin_basename( 'all-in-one-wp-migration-direct-extension/all-in-one-wp-migration-direct-extension.php' ),
|
||||
ai1wm_discover_plugin_basename( 'all-in-one-wp-migration-dropbox-extension/all-in-one-wp-migration-dropbox-extension.php' ),
|
||||
ai1wm_discover_plugin_basename( 'all-in-one-wp-migration-file-extension/all-in-one-wp-migration-file-extension.php' ),
|
||||
ai1wm_discover_plugin_basename( 'all-in-one-wp-migration-ftp-extension/all-in-one-wp-migration-ftp-extension.php' ),
|
||||
ai1wm_discover_plugin_basename( 'all-in-one-wp-migration-gcloud-storage-extension/all-in-one-wp-migration-gcloud-storage-extension.php' ),
|
||||
ai1wm_discover_plugin_basename( 'all-in-one-wp-migration-gdrive-extension/all-in-one-wp-migration-gdrive-extension.php' ),
|
||||
ai1wm_discover_plugin_basename( 'all-in-one-wp-migration-glacier-extension/all-in-one-wp-migration-glacier-extension.php' ),
|
||||
ai1wm_discover_plugin_basename( 'all-in-one-wp-migration-mega-extension/all-in-one-wp-migration-mega-extension.php' ),
|
||||
ai1wm_discover_plugin_basename( 'all-in-one-wp-migration-multisite-extension/all-in-one-wp-migration-multisite-extension.php' ),
|
||||
ai1wm_discover_plugin_basename( 'all-in-one-wp-migration-onedrive-extension/all-in-one-wp-migration-onedrive-extension.php' ),
|
||||
ai1wm_discover_plugin_basename( 'all-in-one-wp-migration-pcloud-extension/all-in-one-wp-migration-pcloud-extension.php' ),
|
||||
ai1wm_discover_plugin_basename( 'all-in-one-wp-migration-pro/all-in-one-wp-migration-pro.php' ),
|
||||
ai1wm_discover_plugin_basename( 'all-in-one-wp-migration-s3-client-extension/all-in-one-wp-migration-s3-client-extension.php' ),
|
||||
ai1wm_discover_plugin_basename( 'all-in-one-wp-migration-s3-extension/all-in-one-wp-migration-s3-extension.php' ),
|
||||
ai1wm_discover_plugin_basename( 'all-in-one-wp-migration-unlimited-extension/all-in-one-wp-migration-unlimited-extension.php' ),
|
||||
ai1wm_discover_plugin_basename( 'all-in-one-wp-migration-url-extension/all-in-one-wp-migration-url-extension.php' ),
|
||||
ai1wm_discover_plugin_basename( 'all-in-one-wp-migration-webdav-extension/all-in-one-wp-migration-webdav-extension.php' ),
|
||||
)
|
||||
);
|
||||
|
||||
// Deactivate Revolution Slider
|
||||
ai1wm_deactivate_revolution_slider( ai1wm_discover_plugin_basename( 'revslider/revslider.php' ) );
|
||||
|
||||
// Deactivate Jetpack modules
|
||||
ai1wm_deactivate_jetpack_modules( array( 'photon', 'sso' ) );
|
||||
|
||||
// Flush Elementor cache
|
||||
ai1wm_elementor_cache_flush();
|
||||
|
||||
// Initial DB version
|
||||
ai1wm_initial_db_version();
|
||||
}
|
||||
}
|
||||
|
||||
// Check blogs.json file
|
||||
if ( is_file( ai1wm_blogs_path( $params ) ) ) {
|
||||
|
||||
// Read blogs.json file
|
||||
$handle = ai1wm_open( ai1wm_blogs_path( $params ), 'r' );
|
||||
|
||||
// Parse blogs.json file
|
||||
$blogs = ai1wm_read( $handle, filesize( ai1wm_blogs_path( $params ) ) );
|
||||
$blogs = json_decode( $blogs, true );
|
||||
|
||||
// Close handle
|
||||
ai1wm_close( $handle );
|
||||
|
||||
// Loop over blogs
|
||||
foreach ( $blogs as $blog ) {
|
||||
|
||||
// Activate WordPress plugins
|
||||
if ( isset( $blog['New']['Plugins'] ) && ( $plugins = $blog['New']['Plugins'] ) ) {
|
||||
ai1wm_activate_plugins( $plugins );
|
||||
}
|
||||
|
||||
// Activate WordPress template
|
||||
if ( isset( $blog['New']['Template'] ) && ( $template = $blog['New']['Template'] ) ) {
|
||||
ai1wm_activate_template( $template );
|
||||
}
|
||||
|
||||
// Activate WordPress stylesheet
|
||||
if ( isset( $blog['New']['Stylesheet'] ) && ( $stylesheet = $blog['New']['Stylesheet'] ) ) {
|
||||
ai1wm_activate_stylesheet( $stylesheet );
|
||||
}
|
||||
|
||||
// Deactivate WordPress SSL plugins
|
||||
if ( ! is_ssl() ) {
|
||||
ai1wm_deactivate_plugins(
|
||||
array(
|
||||
ai1wm_discover_plugin_basename( 'really-simple-ssl/rlrsssl-really-simple-ssl.php' ),
|
||||
ai1wm_discover_plugin_basename( 'wordpress-https/wordpress-https.php' ),
|
||||
ai1wm_discover_plugin_basename( 'wp-force-ssl/wp-force-ssl.php' ),
|
||||
ai1wm_discover_plugin_basename( 'force-https-littlebizzy/force-https.php' ),
|
||||
)
|
||||
);
|
||||
|
||||
ai1wm_woocommerce_force_ssl( false );
|
||||
}
|
||||
|
||||
// Deactivate WordPress plugins
|
||||
ai1wm_deactivate_plugins(
|
||||
array(
|
||||
ai1wm_discover_plugin_basename( 'invisible-recaptcha/invisible-recaptcha.php' ),
|
||||
ai1wm_discover_plugin_basename( 'wps-hide-login/wps-hide-login.php' ),
|
||||
ai1wm_discover_plugin_basename( 'hide-my-wp/index.php' ),
|
||||
ai1wm_discover_plugin_basename( 'hide-my-wordpress/index.php' ),
|
||||
ai1wm_discover_plugin_basename( 'mycustomwidget/my_custom_widget.php' ),
|
||||
ai1wm_discover_plugin_basename( 'lockdown-wp-admin/lockdown-wp-admin.php' ),
|
||||
ai1wm_discover_plugin_basename( 'rename-wp-login/rename-wp-login.php' ),
|
||||
ai1wm_discover_plugin_basename( 'wp-simple-firewall/icwp-wpsf.php' ),
|
||||
ai1wm_discover_plugin_basename( 'join-my-multisite/joinmymultisite.php' ),
|
||||
ai1wm_discover_plugin_basename( 'multisite-clone-duplicator/multisite-clone-duplicator.php' ),
|
||||
ai1wm_discover_plugin_basename( 'wordpress-mu-domain-mapping/domain_mapping.php' ),
|
||||
ai1wm_discover_plugin_basename( 'wordpress-starter/siteground-wizard.php' ),
|
||||
ai1wm_discover_plugin_basename( 'pro-sites/pro-sites.php' ),
|
||||
ai1wm_discover_plugin_basename( 'wpide/WPide.php' ),
|
||||
ai1wm_discover_plugin_basename( 'page-optimize/page-optimize.php' ),
|
||||
)
|
||||
);
|
||||
|
||||
// Deactivate Swift Optimizer rules
|
||||
ai1wm_deactivate_swift_optimizer_rules(
|
||||
array(
|
||||
ai1wm_discover_plugin_basename( 'all-in-one-wp-migration/all-in-one-wp-migration.php' ),
|
||||
ai1wm_discover_plugin_basename( 'all-in-one-wp-migration-azure-storage-extension/all-in-one-wp-migration-azure-storage-extension.php' ),
|
||||
ai1wm_discover_plugin_basename( 'all-in-one-wp-migration-b2-extension/all-in-one-wp-migration-b2-extension.php' ),
|
||||
ai1wm_discover_plugin_basename( 'all-in-one-wp-migration-backup/all-in-one-wp-migration-backup.php' ),
|
||||
ai1wm_discover_plugin_basename( 'all-in-one-wp-migration-box-extension/all-in-one-wp-migration-box-extension.php' ),
|
||||
ai1wm_discover_plugin_basename( 'all-in-one-wp-migration-digitalocean-extension/all-in-one-wp-migration-digitalocean-extension.php' ),
|
||||
ai1wm_discover_plugin_basename( 'all-in-one-wp-migration-direct-extension/all-in-one-wp-migration-direct-extension.php' ),
|
||||
ai1wm_discover_plugin_basename( 'all-in-one-wp-migration-dropbox-extension/all-in-one-wp-migration-dropbox-extension.php' ),
|
||||
ai1wm_discover_plugin_basename( 'all-in-one-wp-migration-file-extension/all-in-one-wp-migration-file-extension.php' ),
|
||||
ai1wm_discover_plugin_basename( 'all-in-one-wp-migration-ftp-extension/all-in-one-wp-migration-ftp-extension.php' ),
|
||||
ai1wm_discover_plugin_basename( 'all-in-one-wp-migration-gcloud-storage-extension/all-in-one-wp-migration-gcloud-storage-extension.php' ),
|
||||
ai1wm_discover_plugin_basename( 'all-in-one-wp-migration-gdrive-extension/all-in-one-wp-migration-gdrive-extension.php' ),
|
||||
ai1wm_discover_plugin_basename( 'all-in-one-wp-migration-glacier-extension/all-in-one-wp-migration-glacier-extension.php' ),
|
||||
ai1wm_discover_plugin_basename( 'all-in-one-wp-migration-mega-extension/all-in-one-wp-migration-mega-extension.php' ),
|
||||
ai1wm_discover_plugin_basename( 'all-in-one-wp-migration-multisite-extension/all-in-one-wp-migration-multisite-extension.php' ),
|
||||
ai1wm_discover_plugin_basename( 'all-in-one-wp-migration-onedrive-extension/all-in-one-wp-migration-onedrive-extension.php' ),
|
||||
ai1wm_discover_plugin_basename( 'all-in-one-wp-migration-pcloud-extension/all-in-one-wp-migration-pcloud-extension.php' ),
|
||||
ai1wm_discover_plugin_basename( 'all-in-one-wp-migration-pro/all-in-one-wp-migration-pro.php' ),
|
||||
ai1wm_discover_plugin_basename( 'all-in-one-wp-migration-s3-client-extension/all-in-one-wp-migration-s3-client-extension.php' ),
|
||||
ai1wm_discover_plugin_basename( 'all-in-one-wp-migration-s3-extension/all-in-one-wp-migration-s3-extension.php' ),
|
||||
ai1wm_discover_plugin_basename( 'all-in-one-wp-migration-unlimited-extension/all-in-one-wp-migration-unlimited-extension.php' ),
|
||||
ai1wm_discover_plugin_basename( 'all-in-one-wp-migration-url-extension/all-in-one-wp-migration-url-extension.php' ),
|
||||
ai1wm_discover_plugin_basename( 'all-in-one-wp-migration-webdav-extension/all-in-one-wp-migration-webdav-extension.php' ),
|
||||
)
|
||||
);
|
||||
|
||||
// Deactivate Revolution Slider
|
||||
ai1wm_deactivate_revolution_slider( ai1wm_discover_plugin_basename( 'revslider/revslider.php' ) );
|
||||
|
||||
// Deactivate Jetpack modules
|
||||
ai1wm_deactivate_jetpack_modules( array( 'photon', 'sso' ) );
|
||||
|
||||
// Flush Elementor cache
|
||||
ai1wm_elementor_cache_flush();
|
||||
|
||||
// Initial DB version
|
||||
ai1wm_initial_db_version();
|
||||
}
|
||||
}
|
||||
|
||||
// Clear auth cookie (WP Cerber)
|
||||
if ( ai1wm_validate_plugin_basename( 'wp-cerber/wp-cerber.php' ) ) {
|
||||
wp_clear_auth_cookie();
|
||||
}
|
||||
|
||||
$should_reset_permalinks = false;
|
||||
|
||||
// Switch to default permalink structure
|
||||
if ( ( $should_reset_permalinks = ai1wm_should_reset_permalinks( $params ) ) ) {
|
||||
$wp_rewrite->set_permalink_structure( '' );
|
||||
}
|
||||
|
||||
// Set progress
|
||||
if ( ai1wm_validate_plugin_basename( 'fusion-builder/fusion-builder.php' ) ) {
|
||||
Ai1wm_Status::done( __( 'Your site has been imported successfully!', AI1WM_PLUGIN_NAME ), Ai1wm_Template::get_content( 'import/avada', array( 'should_reset_permalinks' => $should_reset_permalinks ) ) );
|
||||
} elseif ( ai1wm_validate_plugin_basename( 'oxygen/functions.php' ) ) {
|
||||
Ai1wm_Status::done( __( 'Your site has been imported successfully!', AI1WM_PLUGIN_NAME ), Ai1wm_Template::get_content( 'import/oxygen', array( 'should_reset_permalinks' => $should_reset_permalinks ) ) );
|
||||
} else {
|
||||
Ai1wm_Status::done( __( 'Your site has been imported successfully!', AI1WM_PLUGIN_NAME ), Ai1wm_Template::get_content( 'import/done', array( 'should_reset_permalinks' => $should_reset_permalinks ) ) );
|
||||
}
|
||||
|
||||
return $params;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2014-2020 ServMask Inc.
|
||||
*
|
||||
* 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/>.
|
||||
*
|
||||
* ███████╗███████╗██████╗ ██╗ ██╗███╗ ███╗ █████╗ ███████╗██╗ ██╗
|
||||
* ██╔════╝██╔════╝██╔══██╗██║ ██║████╗ ████║██╔══██╗██╔════╝██║ ██╔╝
|
||||
* ███████╗█████╗ ██████╔╝██║ ██║██╔████╔██║███████║███████╗█████╔╝
|
||||
* ╚════██║██╔══╝ ██╔══██╗╚██╗ ██╔╝██║╚██╔╝██║██╔══██║╚════██║██╔═██╗
|
||||
* ███████║███████╗██║ ██║ ╚████╔╝ ██║ ╚═╝ ██║██║ ██║███████║██║ ██╗
|
||||
* ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
die( 'Kangaroos cannot jump here' );
|
||||
}
|
||||
|
||||
class Ai1wm_Import_Enumerate {
|
||||
|
||||
public static function execute( $params ) {
|
||||
|
||||
// Set progress
|
||||
Ai1wm_Status::info( __( 'Retrieving a list of all WordPress files...', AI1WM_PLUGIN_NAME ) );
|
||||
|
||||
// Open the archive file for reading
|
||||
$archive = new Ai1wm_Extractor( ai1wm_archive_path( $params ) );
|
||||
|
||||
// Get total files count
|
||||
$params['total_files_count'] = $archive->get_total_files_count();
|
||||
|
||||
// Get total files size
|
||||
$params['total_files_size'] = $archive->get_total_files_size();
|
||||
|
||||
// Close the archive file
|
||||
$archive->close();
|
||||
|
||||
// Set progress
|
||||
Ai1wm_Status::info( __( 'Done retrieving a list of all WordPress files.', AI1WM_PLUGIN_NAME ) );
|
||||
|
||||
return $params;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2014-2020 ServMask Inc.
|
||||
*
|
||||
* 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/>.
|
||||
*
|
||||
* ███████╗███████╗██████╗ ██╗ ██╗███╗ ███╗ █████╗ ███████╗██╗ ██╗
|
||||
* ██╔════╝██╔════╝██╔══██╗██║ ██║████╗ ████║██╔══██╗██╔════╝██║ ██╔╝
|
||||
* ███████╗█████╗ ██████╔╝██║ ██║██╔████╔██║███████║███████╗█████╔╝
|
||||
* ╚════██║██╔══╝ ██╔══██╗╚██╗ ██╔╝██║╚██╔╝██║██╔══██║╚════██║██╔═██╗
|
||||
* ███████║███████╗██║ ██║ ╚████╔╝ ██║ ╚═╝ ██║██║ ██║███████║██║ ██╗
|
||||
* ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
die( 'Kangaroos cannot jump here' );
|
||||
}
|
||||
|
||||
class Ai1wm_Import_Mu_Plugins {
|
||||
|
||||
public static function execute( $params ) {
|
||||
|
||||
// Set progress
|
||||
Ai1wm_Status::info( __( 'Activating mu-plugins...', AI1WM_PLUGIN_NAME ) );
|
||||
|
||||
$exclude_files = array(
|
||||
AI1WM_MUPLUGINS_NAME . DIRECTORY_SEPARATOR . AI1WM_ENDURANCE_PAGE_CACHE_NAME,
|
||||
AI1WM_MUPLUGINS_NAME . DIRECTORY_SEPARATOR . AI1WM_ENDURANCE_PHP_EDGE_NAME,
|
||||
AI1WM_MUPLUGINS_NAME . DIRECTORY_SEPARATOR . AI1WM_ENDURANCE_BROWSER_CACHE_NAME,
|
||||
AI1WM_MUPLUGINS_NAME . DIRECTORY_SEPARATOR . AI1WM_GD_SYSTEM_PLUGIN_NAME,
|
||||
AI1WM_MUPLUGINS_NAME . DIRECTORY_SEPARATOR . AI1WM_WP_STACK_CACHE_NAME,
|
||||
AI1WM_MUPLUGINS_NAME . DIRECTORY_SEPARATOR . AI1WM_WP_COMSH_LOADER_NAME,
|
||||
AI1WM_MUPLUGINS_NAME . DIRECTORY_SEPARATOR . AI1WM_WP_COMSH_HELPER_NAME,
|
||||
AI1WM_MUPLUGINS_NAME . DIRECTORY_SEPARATOR . AI1WM_WP_ENGINE_SYSTEM_PLUGIN_NAME,
|
||||
AI1WM_MUPLUGINS_NAME . DIRECTORY_SEPARATOR . AI1WM_WPE_SIGN_ON_PLUGIN_NAME,
|
||||
AI1WM_MUPLUGINS_NAME . DIRECTORY_SEPARATOR . AI1WM_WP_ENGINE_SECURITY_AUDITOR_NAME,
|
||||
AI1WM_MUPLUGINS_NAME . DIRECTORY_SEPARATOR . AI1WM_WP_CERBER_SECURITY_NAME,
|
||||
);
|
||||
|
||||
// Open the archive file for reading
|
||||
$archive = new Ai1wm_Extractor( ai1wm_archive_path( $params ) );
|
||||
|
||||
// Unpack mu-plugins files
|
||||
$archive->extract_by_files_array( WP_CONTENT_DIR, array( AI1WM_MUPLUGINS_NAME ), $exclude_files );
|
||||
|
||||
// Close the archive file
|
||||
$archive->close();
|
||||
|
||||
// Set progress
|
||||
Ai1wm_Status::info( __( 'Done activating mu-plugins.', AI1WM_PLUGIN_NAME ) );
|
||||
|
||||
return $params;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2014-2020 ServMask Inc.
|
||||
*
|
||||
* 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/>.
|
||||
*
|
||||
* ███████╗███████╗██████╗ ██╗ ██╗███╗ ███╗ █████╗ ███████╗██╗ ██╗
|
||||
* ██╔════╝██╔════╝██╔══██╗██║ ██║████╗ ████║██╔══██╗██╔════╝██║ ██╔╝
|
||||
* ███████╗█████╗ ██████╔╝██║ ██║██╔████╔██║███████║███████╗█████╔╝
|
||||
* ╚════██║██╔══╝ ██╔══██╗╚██╗ ██╔╝██║╚██╔╝██║██╔══██║╚════██║██╔═██╗
|
||||
* ███████║███████╗██║ ██║ ╚████╔╝ ██║ ╚═╝ ██║██║ ██║███████║██║ ██╗
|
||||
* ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
die( 'Kangaroos cannot jump here' );
|
||||
}
|
||||
|
||||
class Ai1wm_Import_Options {
|
||||
|
||||
public static function execute( $params, Ai1wm_Database $mysql = null ) {
|
||||
global $wpdb;
|
||||
|
||||
// Set progress
|
||||
Ai1wm_Status::info( __( 'Preparing options...', AI1WM_PLUGIN_NAME ) );
|
||||
|
||||
// Get database client
|
||||
if ( is_null( $mysql ) ) {
|
||||
if ( empty( $wpdb->use_mysqli ) ) {
|
||||
$mysql = new Ai1wm_Database_Mysql( $wpdb );
|
||||
} else {
|
||||
$mysql = new Ai1wm_Database_Mysqli( $wpdb );
|
||||
}
|
||||
}
|
||||
|
||||
$tables = $mysql->get_tables();
|
||||
|
||||
// Get base prefix
|
||||
$base_prefix = ai1wm_table_prefix();
|
||||
|
||||
// Get mainsite prefix
|
||||
$mainsite_prefix = ai1wm_table_prefix( 'mainsite' );
|
||||
|
||||
// Check WP sitemeta table exists
|
||||
if ( in_array( "{$mainsite_prefix}sitemeta", $tables ) ) {
|
||||
|
||||
// Get fs_accounts option value (Freemius)
|
||||
$result = $mysql->query( "SELECT meta_value FROM `{$mainsite_prefix}sitemeta` WHERE meta_key = 'fs_accounts'" );
|
||||
if ( ( $row = $mysql->fetch_assoc( $result ) ) ) {
|
||||
$fs_accounts = get_option( 'fs_accounts', array() );
|
||||
$meta_value = maybe_unserialize( $row['meta_value'] );
|
||||
|
||||
// Update fs_accounts option value (Freemius)
|
||||
if ( ( $fs_accounts = array_merge( $fs_accounts, $meta_value ) ) ) {
|
||||
if ( isset( $fs_accounts['users'], $fs_accounts['sites'] ) ) {
|
||||
update_option( 'fs_accounts', $fs_accounts );
|
||||
} else {
|
||||
delete_option( 'fs_accounts' );
|
||||
delete_option( 'fs_dbg_accounts' );
|
||||
delete_option( 'fs_active_plugins' );
|
||||
delete_option( 'fs_api_cache' );
|
||||
delete_option( 'fs_dbg_api_cache' );
|
||||
delete_option( 'fs_debug_mode' );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Set progress
|
||||
Ai1wm_Status::info( __( 'Done preparing options.', AI1WM_PLUGIN_NAME ) );
|
||||
|
||||
return $params;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2014-2020 ServMask Inc.
|
||||
*
|
||||
* 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/>.
|
||||
*
|
||||
* ███████╗███████╗██████╗ ██╗ ██╗███╗ ███╗ █████╗ ███████╗██╗ ██╗
|
||||
* ██╔════╝██╔════╝██╔══██╗██║ ██║████╗ ████║██╔══██╗██╔════╝██║ ██╔╝
|
||||
* ███████╗█████╗ ██████╔╝██║ ██║██╔████╔██║███████║███████╗█████╔╝
|
||||
* ╚════██║██╔══╝ ██╔══██╗╚██╗ ██╔╝██║╚██╔╝██║██╔══██║╚════██║██╔═██╗
|
||||
* ███████║███████╗██║ ██║ ╚████╔╝ ██║ ╚═╝ ██║██║ ██║███████║██║ ██╗
|
||||
* ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
die( 'Kangaroos cannot jump here' );
|
||||
}
|
||||
|
||||
class Ai1wm_Import_Permalinks {
|
||||
|
||||
public static function execute( $params ) {
|
||||
global $wp_rewrite;
|
||||
|
||||
// Set progress
|
||||
Ai1wm_Status::info( __( 'Getting WordPress permalinks settings...', AI1WM_PLUGIN_NAME ) );
|
||||
|
||||
// Get using permalinks
|
||||
$params['using_permalinks'] = (int) $wp_rewrite->using_permalinks();
|
||||
|
||||
// Set progress
|
||||
Ai1wm_Status::info( __( 'Done getting WordPress permalinks settings.', AI1WM_PLUGIN_NAME ) );
|
||||
|
||||
return $params;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,97 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2014-2020 ServMask Inc.
|
||||
*
|
||||
* 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/>.
|
||||
*
|
||||
* ███████╗███████╗██████╗ ██╗ ██╗███╗ ███╗ █████╗ ███████╗██╗ ██╗
|
||||
* ██╔════╝██╔════╝██╔══██╗██║ ██║████╗ ████║██╔══██╗██╔════╝██║ ██╔╝
|
||||
* ███████╗█████╗ ██████╔╝██║ ██║██╔████╔██║███████║███████╗█████╔╝
|
||||
* ╚════██║██╔══╝ ██╔══██╗╚██╗ ██╔╝██║╚██╔╝██║██╔══██║╚════██║██╔═██╗
|
||||
* ███████║███████╗██║ ██║ ╚████╔╝ ██║ ╚═╝ ██║██║ ██║███████║██║ ██╗
|
||||
* ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
die( 'Kangaroos cannot jump here' );
|
||||
}
|
||||
|
||||
class Ai1wm_Import_Upload {
|
||||
|
||||
private static function validate() {
|
||||
if ( ! array_key_exists( 'upload-file', $_FILES ) || ! is_array( $_FILES['upload-file'] ) ) {
|
||||
throw new Ai1wm_Import_Retry_Exception( __( 'Missing upload file.', AI1WM_PLUGIN_NAME ), 400 );
|
||||
}
|
||||
|
||||
if ( ! array_key_exists( 'error', $_FILES['upload-file'] ) ) {
|
||||
throw new Ai1wm_Import_Retry_Exception( __( 'Missing error key in upload file.', AI1WM_PLUGIN_NAME ), 400 );
|
||||
}
|
||||
|
||||
if ( ! array_key_exists( 'tmp_name', $_FILES['upload-file'] ) ) {
|
||||
throw new Ai1wm_Import_Retry_Exception( __( 'Missing tmp_name in upload file.', AI1WM_PLUGIN_NAME ), 400 );
|
||||
}
|
||||
}
|
||||
|
||||
public static function execute( $params ) {
|
||||
self::validate();
|
||||
|
||||
$error = $_FILES['upload-file']['error'];
|
||||
$upload = $_FILES['upload-file']['tmp_name'];
|
||||
|
||||
// Verify file name extension
|
||||
if ( ! ai1wm_is_filename_supported( ai1wm_archive_path( $params ) ) ) {
|
||||
throw new Ai1wm_Import_Exception(
|
||||
__(
|
||||
'The file type that you have tried to upload is not compatible with this plugin. ' .
|
||||
'Please ensure that your file is a <strong>.wpress</strong> file that was created with the All-in-One WP migration plugin. ' .
|
||||
'<a href="https://help.servmask.com/knowledgebase/invalid-backup-file/" target="_blank">Technical details</a>',
|
||||
AI1WM_PLUGIN_NAME
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
switch ( $error ) {
|
||||
case UPLOAD_ERR_OK:
|
||||
try {
|
||||
ai1wm_copy( $upload, ai1wm_archive_path( $params ) );
|
||||
ai1wm_unlink( $upload );
|
||||
} catch ( Exception $e ) {
|
||||
throw new Ai1wm_Import_Retry_Exception( sprintf( __( 'Unable to upload the file because %s', AI1WM_PLUGIN_NAME ), $e->getMessage() ), 400 );
|
||||
}
|
||||
break;
|
||||
|
||||
case UPLOAD_ERR_INI_SIZE:
|
||||
case UPLOAD_ERR_FORM_SIZE:
|
||||
case UPLOAD_ERR_PARTIAL:
|
||||
case UPLOAD_ERR_NO_FILE:
|
||||
// File is too large
|
||||
throw new Ai1wm_Import_Retry_Exception( __( 'The file is too large for this server.', AI1WM_PLUGIN_NAME ), 413 );
|
||||
|
||||
case UPLOAD_ERR_NO_TMP_DIR:
|
||||
throw new Ai1wm_Import_Retry_Exception( __( 'Missing a temporary folder.', AI1WM_PLUGIN_NAME ), 400 );
|
||||
|
||||
case UPLOAD_ERR_CANT_WRITE:
|
||||
throw new Ai1wm_Import_Retry_Exception( __( 'Failed to write file to disk.', AI1WM_PLUGIN_NAME ), 400 );
|
||||
|
||||
case UPLOAD_ERR_EXTENSION:
|
||||
throw new Ai1wm_Import_Retry_Exception( __( 'A PHP extension stopped the file upload.', AI1WM_PLUGIN_NAME ), 400 );
|
||||
|
||||
default:
|
||||
throw new Ai1wm_Import_Retry_Exception( sprintf( __( 'Unrecognized error %s during upload.', AI1WM_PLUGIN_NAME ), $error ), 400 );
|
||||
}
|
||||
|
||||
echo json_encode( array( 'errors' => array() ) );
|
||||
exit;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,159 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2014-2020 ServMask Inc.
|
||||
*
|
||||
* 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/>.
|
||||
*
|
||||
* ███████╗███████╗██████╗ ██╗ ██╗███╗ ███╗ █████╗ ███████╗██╗ ██╗
|
||||
* ██╔════╝██╔════╝██╔══██╗██║ ██║████╗ ████║██╔══██╗██╔════╝██║ ██╔╝
|
||||
* ███████╗█████╗ ██████╔╝██║ ██║██╔████╔██║███████║███████╗█████╔╝
|
||||
* ╚════██║██╔══╝ ██╔══██╗╚██╗ ██╔╝██║╚██╔╝██║██╔══██║╚════██║██╔═██╗
|
||||
* ███████║███████╗██║ ██║ ╚████╔╝ ██║ ╚═╝ ██║██║ ██║███████║██║ ██╗
|
||||
* ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
die( 'Kangaroos cannot jump here' );
|
||||
}
|
||||
|
||||
class Ai1wm_Import_Validate {
|
||||
|
||||
public static function execute( $params ) {
|
||||
|
||||
// Verify file if size > 2GB and PHP = 32-bit
|
||||
if ( ! ai1wm_is_filesize_supported( ai1wm_archive_path( $params ) ) ) {
|
||||
throw new Ai1wm_Import_Exception(
|
||||
__(
|
||||
'Your PHP is 32-bit. In order to import your file, please change your PHP version to 64-bit and try again. ' .
|
||||
'<a href="https://help.servmask.com/knowledgebase/php-32bit/" target="_blank">Technical details</a>',
|
||||
AI1WM_PLUGIN_NAME
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
// Verify file name extension
|
||||
if ( ! ai1wm_is_filename_supported( ai1wm_archive_path( $params ) ) ) {
|
||||
throw new Ai1wm_Import_Exception(
|
||||
__(
|
||||
'The file type that you have tried to import is not compatible with this plugin. ' .
|
||||
'Please ensure that your file is a <strong>.wpress</strong> file that was created with the All-in-One WP migration plugin. ' .
|
||||
'<a href="https://help.servmask.com/knowledgebase/invalid-backup-file/" target="_blank">Technical details</a>',
|
||||
AI1WM_PLUGIN_NAME
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
// Set archive bytes offset
|
||||
if ( isset( $params['archive_bytes_offset'] ) ) {
|
||||
$archive_bytes_offset = (int) $params['archive_bytes_offset'];
|
||||
} else {
|
||||
$archive_bytes_offset = 0;
|
||||
}
|
||||
|
||||
// Set file bytes offset
|
||||
if ( isset( $params['file_bytes_offset'] ) ) {
|
||||
$file_bytes_offset = (int) $params['file_bytes_offset'];
|
||||
} else {
|
||||
$file_bytes_offset = 0;
|
||||
}
|
||||
|
||||
// Get total archive size
|
||||
if ( isset( $params['total_archive_size'] ) ) {
|
||||
$total_archive_size = (int) $params['total_archive_size'];
|
||||
} else {
|
||||
$total_archive_size = ai1wm_archive_bytes( $params );
|
||||
}
|
||||
|
||||
// What percent of archive have we processed?
|
||||
$progress = (int) min( ( $archive_bytes_offset / $total_archive_size ) * 100, 100 );
|
||||
|
||||
// Set progress
|
||||
Ai1wm_Status::info( sprintf( __( 'Unpacking archive...<br />%d%% complete', AI1WM_PLUGIN_NAME ), $progress ) );
|
||||
|
||||
// Open the archive file for reading
|
||||
$archive = new Ai1wm_Extractor( ai1wm_archive_path( $params ) );
|
||||
|
||||
// Set the file pointer to the one that we have saved
|
||||
$archive->set_file_pointer( $archive_bytes_offset );
|
||||
|
||||
// Validate the archive file consistency
|
||||
if ( ! $archive->is_valid() ) {
|
||||
throw new Ai1wm_Import_Exception( __( 'The archive file is corrupted. Follow <a href="https://help.servmask.com/knowledgebase/corrupted-archive/" target="_blank">this article</a> to resolve the problem.', AI1WM_PLUGIN_NAME ) );
|
||||
}
|
||||
|
||||
// Flag to hold if file data has been processed
|
||||
$completed = true;
|
||||
|
||||
if ( $archive->has_not_reached_eof() ) {
|
||||
$file_bytes_written = 0;
|
||||
|
||||
// Unpack package.json, multisite.json and database.sql files
|
||||
if ( ( $completed = $archive->extract_by_files_array( ai1wm_storage_path( $params ), array( AI1WM_PACKAGE_NAME, AI1WM_MULTISITE_NAME, AI1WM_DATABASE_NAME ), array(), array(), $file_bytes_written, $file_bytes_offset ) ) ) {
|
||||
$file_bytes_offset = 0;
|
||||
}
|
||||
|
||||
// Get archive bytes offset
|
||||
$archive_bytes_offset = $archive->get_file_pointer();
|
||||
}
|
||||
|
||||
// End of the archive?
|
||||
if ( $archive->has_reached_eof() ) {
|
||||
|
||||
// Check package.json file
|
||||
if ( false === is_file( ai1wm_package_path( $params ) ) ) {
|
||||
throw new Ai1wm_Import_Exception( __( 'Please make sure that your file was exported using <strong>All-in-One WP Migration</strong> plugin. <a href="https://help.servmask.com/knowledgebase/invalid-backup-file/" target="_blank">Technical details</a>', AI1WM_PLUGIN_NAME ) );
|
||||
}
|
||||
|
||||
// Set progress
|
||||
Ai1wm_Status::info( __( 'Done unpacking archive.', AI1WM_PLUGIN_NAME ) );
|
||||
|
||||
// Unset archive bytes offset
|
||||
unset( $params['archive_bytes_offset'] );
|
||||
|
||||
// Unset file bytes offset
|
||||
unset( $params['file_bytes_offset'] );
|
||||
|
||||
// Unset total archive size
|
||||
unset( $params['total_archive_size'] );
|
||||
|
||||
// Unset completed flag
|
||||
unset( $params['completed'] );
|
||||
|
||||
} else {
|
||||
|
||||
// What percent of archive have we processed?
|
||||
$progress = (int) min( ( $archive_bytes_offset / $total_archive_size ) * 100, 100 );
|
||||
|
||||
// Set progress
|
||||
Ai1wm_Status::info( sprintf( __( 'Unpacking archive...<br />%d%% complete', AI1WM_PLUGIN_NAME ), $progress ) );
|
||||
|
||||
// Set archive bytes offset
|
||||
$params['archive_bytes_offset'] = $archive_bytes_offset;
|
||||
|
||||
// Set file bytes offset
|
||||
$params['file_bytes_offset'] = $file_bytes_offset;
|
||||
|
||||
// Set total archive size
|
||||
$params['total_archive_size'] = $total_archive_size;
|
||||
|
||||
// Set completed flag
|
||||
$params['completed'] = $completed;
|
||||
}
|
||||
|
||||
// Close the archive file
|
||||
$archive->close();
|
||||
|
||||
return $params;
|
||||
}
|
||||
}
|
||||
20
wp-content/plugins/all-in-one-wp-migration/lib/vendor/bandar/bandar/LICENSE
vendored
Normal file
20
wp-content/plugins/all-in-one-wp-migration/lib/vendor/bandar/bandar/LICENSE
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2013 Yani Iliev
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||
the Software, and to permit persons to whom the Software is furnished to do so,
|
||||
subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
233
wp-content/plugins/all-in-one-wp-migration/lib/vendor/bandar/bandar/lib/Bandar.php
vendored
Normal file
233
wp-content/plugins/all-in-one-wp-migration/lib/vendor/bandar/bandar/lib/Bandar.php
vendored
Normal file
@@ -0,0 +1,233 @@
|
||||
<?php
|
||||
|
||||
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
|
||||
|
||||
/**
|
||||
* Main template engine file
|
||||
*
|
||||
* PHP version 5
|
||||
*
|
||||
* LICENSE: Permission is hereby granted, free of charge, to any person obtaining
|
||||
* a copy of this software and associated documentation files (the "Software"), to
|
||||
* deal in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
* of the Software, and to permit persons to whom the Software is furnished to do so,
|
||||
* subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* @category Templates
|
||||
* @package Bandar
|
||||
* @author Yani Iliev <yani@iliev.me>
|
||||
* @copyright 2013 Yani Iliev
|
||||
* @license https://raw.github.com/yani-/bandar/master/LICENSE The MIT License (MIT)
|
||||
* @version GIT: 3.0.0
|
||||
* @link https://github.com/yani-/bandar/
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
die( 'Kangaroos cannot jump here' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Define EOL for CLI and Web
|
||||
*/
|
||||
if (!defined('BANDAR_EOL')) {
|
||||
define('BANDAR_EOL', php_sapi_name() === 'cli' ? PHP_EOL : '<br />');
|
||||
}
|
||||
|
||||
/**
|
||||
* Include exceptions
|
||||
*/
|
||||
require_once
|
||||
dirname(__FILE__) .
|
||||
DIRECTORY_SEPARATOR .
|
||||
'Exceptions' .
|
||||
DIRECTORY_SEPARATOR .
|
||||
'TemplateDoesNotExistException.php';
|
||||
|
||||
/**
|
||||
* Bandar Main class
|
||||
*
|
||||
* @category Templates
|
||||
* @package Bandar
|
||||
* @author Yani Iliev <yani@iliev.me>
|
||||
* @copyright 2013 Yani Iliev
|
||||
* @license https://raw.github.com/yani-/bandar/master/LICENSE The MIT License (MIT)
|
||||
* @version Release: 2.0.1
|
||||
* @link https://github.com/yani-/bandar/
|
||||
*/
|
||||
class Bandar
|
||||
{
|
||||
/**
|
||||
* Path to template files
|
||||
*
|
||||
* @var string|null
|
||||
*/
|
||||
public static $templatesPath = null;
|
||||
|
||||
/**
|
||||
* Template file to output
|
||||
* @var string|null
|
||||
*/
|
||||
public static $template = null;
|
||||
|
||||
/**
|
||||
* Outputs the passed string if Bandar is in debug mode
|
||||
*
|
||||
* @param string $str Debug string to output
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public static function debug($str)
|
||||
{
|
||||
/**
|
||||
* if debug flag is on, output the string
|
||||
*/
|
||||
if (defined('BANDAR_DEBUG') && BANDAR_DEBUG) {
|
||||
echo $str;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves templatesPath from BANDAR_TEMPLATES_PATH constant
|
||||
*
|
||||
* @throws TemplatesPathNotSetException If BANDAR_TEMPLATES_PATH is not defined
|
||||
*
|
||||
* @return string|null Templates path
|
||||
*/
|
||||
public static function getTemplatesPathFromConstant()
|
||||
{
|
||||
self::debug(
|
||||
'Calling getTemplatesPathFromConstant' . BANDAR_EOL
|
||||
);
|
||||
if (defined('BANDAR_TEMPLATES_PATH')) {
|
||||
return realpath(BANDAR_TEMPLATES_PATH) . DIRECTORY_SEPARATOR;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for template
|
||||
*
|
||||
* @param string $template Template file
|
||||
*
|
||||
* @throws TemplateDoesNotExistException If template file is not found
|
||||
*
|
||||
* @return null
|
||||
*/
|
||||
public static function setTemplate($template, $path = false)
|
||||
{
|
||||
self::debug(
|
||||
'Calling setTemplate with' . BANDAR_EOL .
|
||||
'$template = ' . $template . BANDAR_EOL .
|
||||
'type of $template is ' . gettype($template) . BANDAR_EOL
|
||||
);
|
||||
|
||||
if ($path) {
|
||||
$template = realpath($path) . DIRECTORY_SEPARATOR . $template;
|
||||
} else {
|
||||
$template = self::getTemplatesPathFromConstant() . $template;
|
||||
}
|
||||
|
||||
$template = realpath($template . '.php');
|
||||
/**
|
||||
* Check if passed template exist
|
||||
*/
|
||||
if (self::templateExists($template)) {
|
||||
self::$template = $template;
|
||||
} else {
|
||||
throw new TemplateDoesNotExistException;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if template exists by using file_exists
|
||||
*
|
||||
* @param string $template Template file
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public static function templateExists($template)
|
||||
{
|
||||
self::debug(
|
||||
'Calling templateExists with ' . BANDAR_EOL .
|
||||
'$template = ' . $template . BANDAR_EOL .
|
||||
'type of $template is ' . gettype($template) . BANDAR_EOL
|
||||
);
|
||||
return (!is_dir($template) && is_readable($template));
|
||||
}
|
||||
|
||||
/**
|
||||
* Renders a passed template
|
||||
*
|
||||
* @param string $template Template name
|
||||
* @param array $args Variables to pass to the template file
|
||||
*
|
||||
* @return string Contents of the template
|
||||
*/
|
||||
public static function render($template, $args=array(), $path = false)
|
||||
{
|
||||
self::debug(
|
||||
'Calling render with' .
|
||||
'$template = ' . $template . BANDAR_EOL .
|
||||
'type of $template is ' . gettype($template) . BANDAR_EOL .
|
||||
'$args = ' . print_r($args, true) . BANDAR_EOL .
|
||||
'type of $args is ' . gettype($args) . BANDAR_EOL
|
||||
);
|
||||
self::setTemplate($template, $path);
|
||||
/**
|
||||
* Extracting passed aguments
|
||||
*/
|
||||
extract($args);
|
||||
ob_start();
|
||||
/**
|
||||
* Including the view
|
||||
*/
|
||||
include self::$template;
|
||||
|
||||
return ob_get_flush();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the content of a passed template
|
||||
*
|
||||
* @param string $template Template name
|
||||
* @param array $args Variables to pass to the template file
|
||||
*
|
||||
* @return string Contents of the template
|
||||
*/
|
||||
public static function getTemplateContent($template, $args=array(), $path = false)
|
||||
{
|
||||
self::debug(
|
||||
'Calling render with' .
|
||||
'$template = ' . $template . BANDAR_EOL .
|
||||
'type of $template is ' . gettype($template) . BANDAR_EOL .
|
||||
'$args = ' . print_r($args, true) . BANDAR_EOL .
|
||||
'type of $args is ' . gettype($args) . BANDAR_EOL
|
||||
);
|
||||
self::setTemplate($template, $path);
|
||||
/**
|
||||
* Extracting passed aguments
|
||||
*/
|
||||
extract($args);
|
||||
ob_start();
|
||||
/**
|
||||
* Including the view
|
||||
*/
|
||||
include self::$template;
|
||||
|
||||
$content = ob_get_contents();
|
||||
ob_end_clean();
|
||||
|
||||
return $content;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
|
||||
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
|
||||
|
||||
/**
|
||||
* Contains TemplateDoesNotExistException class to be used in main Bandar class
|
||||
*
|
||||
* PHP version 5
|
||||
*
|
||||
* LICENSE: Permission is hereby granted, free of charge, to any person obtaining
|
||||
* a copy of this software and associated documentation files (the "Software"), to
|
||||
* deal in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
* of the Software, and to permit persons to whom the Software is furnished to do so,
|
||||
* subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* @category Exceptions
|
||||
* @package Bandar
|
||||
* @author Yani Iliev <yani@iliev.me>
|
||||
* @copyright 2013 Yani Iliev
|
||||
* @license https://raw.github.com/yani-/bandar/master/LICENSE The MIT License (MIT)
|
||||
* @version GIT: 3.0.0
|
||||
* @link https://github.com/yani-/bandar/
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
die( 'Kangaroos cannot jump here' );
|
||||
}
|
||||
|
||||
/**
|
||||
* TemplateDoesNotExistException
|
||||
*
|
||||
* @category Exceptions
|
||||
* @package Bandar
|
||||
* @author Yani Iliev <yani@iliev.me>
|
||||
* @copyright 2013 Yani Iliev
|
||||
* @license https://raw.github.com/yani-/bandar/master/LICENSE The MIT License (MIT)
|
||||
* @version Release: 2.0.1
|
||||
* @link https://github.com/yani-/bandar/
|
||||
*/
|
||||
class TemplateDoesNotExistException extends Exception
|
||||
{
|
||||
|
||||
}
|
||||
257
wp-content/plugins/all-in-one-wp-migration/lib/vendor/servmask/archiver/class-ai1wm-archiver.php
vendored
Normal file
257
wp-content/plugins/all-in-one-wp-migration/lib/vendor/servmask/archiver/class-ai1wm-archiver.php
vendored
Normal file
@@ -0,0 +1,257 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2014-2020 ServMask Inc.
|
||||
*
|
||||
* 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/>.
|
||||
*
|
||||
* ███████╗███████╗██████╗ ██╗ ██╗███╗ ███╗ █████╗ ███████╗██╗ ██╗
|
||||
* ██╔════╝██╔════╝██╔══██╗██║ ██║████╗ ████║██╔══██╗██╔════╝██║ ██╔╝
|
||||
* ███████╗█████╗ ██████╔╝██║ ██║██╔████╔██║███████║███████╗█████╔╝
|
||||
* ╚════██║██╔══╝ ██╔══██╗╚██╗ ██╔╝██║╚██╔╝██║██╔══██║╚════██║██╔═██╗
|
||||
* ███████║███████╗██║ ██║ ╚████╔╝ ██║ ╚═╝ ██║██║ ██║███████║██║ ██╗
|
||||
* ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
die( 'Kangaroos cannot jump here' );
|
||||
}
|
||||
|
||||
abstract class Ai1wm_Archiver {
|
||||
|
||||
/**
|
||||
* Filename including path to the file
|
||||
*
|
||||
* @type string
|
||||
*/
|
||||
protected $file_name = null;
|
||||
|
||||
/**
|
||||
* Handle to the file
|
||||
*
|
||||
* @type resource
|
||||
*/
|
||||
protected $file_handle = null;
|
||||
|
||||
/**
|
||||
* Header block format of a file
|
||||
*
|
||||
* Field Name Offset Length Contents
|
||||
* name 0 255 filename (no path, no slash)
|
||||
* size 255 14 size of file contents
|
||||
* mtime 269 12 last modification time
|
||||
* prefix 281 4096 path name, no trailing slashes
|
||||
*
|
||||
* @type array
|
||||
*/
|
||||
protected $block_format = array(
|
||||
'a255', // filename
|
||||
'a14', // size of file contents
|
||||
'a12', // last time modified
|
||||
'a4096', // path
|
||||
);
|
||||
|
||||
/**
|
||||
* End of file block string
|
||||
*
|
||||
* @type string
|
||||
*/
|
||||
protected $eof = null;
|
||||
|
||||
/**
|
||||
* Default constructor
|
||||
*
|
||||
* Initializes filename and end of file block
|
||||
*
|
||||
* @param string $file_name Archive file
|
||||
* @param bool $write Read/write mode
|
||||
*/
|
||||
public function __construct( $file_name, $write = false ) {
|
||||
$this->file_name = $file_name;
|
||||
|
||||
// Initialize end of file block
|
||||
$this->eof = pack( 'a4377', '' );
|
||||
|
||||
// Open archive file
|
||||
if ( $write ) {
|
||||
// Open archive file for writing
|
||||
if ( ( $this->file_handle = @fopen( $file_name, 'cb' ) ) === false ) {
|
||||
throw new Ai1wm_Not_Accessible_Exception( sprintf( __( 'Unable to open file for writing. File: %s', AI1WM_PLUGIN_NAME ), $this->file_name ) );
|
||||
}
|
||||
|
||||
// Seek to end of archive file
|
||||
if ( @fseek( $this->file_handle, 0, SEEK_END ) === -1 ) {
|
||||
throw new Ai1wm_Not_Seekable_Exception( sprintf( __( 'Unable to seek to end of file. File: %s', AI1WM_PLUGIN_NAME ), $this->file_name ) );
|
||||
}
|
||||
} else {
|
||||
// Open archive file for reading
|
||||
if ( ( $this->file_handle = @fopen( $file_name, 'rb' ) ) === false ) {
|
||||
throw new Ai1wm_Not_Accessible_Exception( sprintf( __( 'Unable to open file for reading. File: %s', AI1WM_PLUGIN_NAME ), $this->file_name ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set current file pointer
|
||||
*
|
||||
* @param int $offset Archive offset
|
||||
*
|
||||
* @throws \Ai1wm_Not_Seekable_Exception
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function set_file_pointer( $offset ) {
|
||||
if ( @fseek( $this->file_handle, $offset, SEEK_SET ) === -1 ) {
|
||||
throw new Ai1wm_Not_Seekable_Exception( sprintf( __( 'Unable to seek to offset of file. File: %s Offset: %d', AI1WM_PLUGIN_NAME ), $this->file_name, $offset ) );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get current file pointer
|
||||
*
|
||||
* @throws \Ai1wm_Not_Tellable_Exception
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function get_file_pointer() {
|
||||
if ( ( $offset = @ftell( $this->file_handle ) ) === false ) {
|
||||
throw new Ai1wm_Not_Tellable_Exception( sprintf( __( 'Unable to tell offset of file. File: %s', AI1WM_PLUGIN_NAME ), $this->file_name ) );
|
||||
}
|
||||
|
||||
return $offset;
|
||||
}
|
||||
|
||||
/**
|
||||
* Appends end of file block to the archive file
|
||||
*
|
||||
* @throws \Ai1wm_Not_Seekable_Exception
|
||||
* @throws \Ai1wm_Not_Writable_Exception
|
||||
* @throws \Ai1wm_Quota_Exceeded_Exception
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function append_eof() {
|
||||
// Seek to end of archive file
|
||||
if ( @fseek( $this->file_handle, 0, SEEK_END ) === -1 ) {
|
||||
throw new Ai1wm_Not_Seekable_Exception( sprintf( __( 'Unable to seek to end of file. File: %s', AI1WM_PLUGIN_NAME ), $this->file_name ) );
|
||||
}
|
||||
|
||||
// Write end of file block
|
||||
if ( ( $file_bytes = @fwrite( $this->file_handle, $this->eof ) ) !== false ) {
|
||||
if ( strlen( $this->eof ) !== $file_bytes ) {
|
||||
throw new Ai1wm_Quota_Exceeded_Exception( sprintf( __( 'Out of disk space. Unable to write end of block to file. File: %s', AI1WM_PLUGIN_NAME ), $this->file_name ) );
|
||||
}
|
||||
} else {
|
||||
throw new Ai1wm_Not_Writable_Exception( sprintf( __( 'Unable to write end of block to file. File: %s', AI1WM_PLUGIN_NAME ), $this->file_name ) );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Replace forward slash with current directory separator
|
||||
*
|
||||
* @param string $path Path
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function replace_forward_slash_with_directory_separator( $path ) {
|
||||
return str_replace( '/', DIRECTORY_SEPARATOR, $path );
|
||||
}
|
||||
|
||||
/**
|
||||
* Replace current directory separator with forward slash
|
||||
*
|
||||
* @param string $path Path
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function replace_directory_separator_with_forward_slash( $path ) {
|
||||
return str_replace( DIRECTORY_SEPARATOR, '/', $path );
|
||||
}
|
||||
|
||||
/**
|
||||
* Escape Windows directory separator
|
||||
*
|
||||
* @param string $path Path
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function escape_windows_directory_separator( $path ) {
|
||||
return preg_replace( '/[\\\\]+/', '\\\\\\\\', $path );
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate archive file
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function is_valid() {
|
||||
// Failed detecting the current file pointer offset
|
||||
if ( ( $offset = @ftell( $this->file_handle ) ) === false ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Failed seeking the beginning of EOL block
|
||||
if ( @fseek( $this->file_handle, -4377, SEEK_END ) === -1 ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Trailing block does not match EOL: file is incomplete
|
||||
if ( @fread( $this->file_handle, 4377 ) !== $this->eof ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Failed returning to original offset
|
||||
if ( @fseek( $this->file_handle, $offset, SEEK_SET ) === -1 ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Truncates the archive file
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function truncate() {
|
||||
if ( ( $offset = @ftell( $this->file_handle ) ) === false ) {
|
||||
throw new Ai1wm_Not_Tellable_Exception( sprintf( __( 'Unable to tell offset of file. File: %s', AI1WM_PLUGIN_NAME ), $this->file_name ) );
|
||||
}
|
||||
|
||||
if ( @filesize( $this->file_name ) > $offset ) {
|
||||
if ( @ftruncate( $this->file_handle, $offset ) === false ) {
|
||||
throw new Ai1wm_Not_Truncatable_Exception( sprintf( __( 'Unable to truncate file. File: %s', AI1WM_PLUGIN_NAME ), $this->file_name ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Closes the archive file
|
||||
*
|
||||
* We either close the file or append the end of file block if complete argument is set to true
|
||||
*
|
||||
* @param bool $complete Flag to append end of file block
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function close( $complete = false ) {
|
||||
// Are we done appending to the file?
|
||||
if ( true === $complete ) {
|
||||
$this->append_eof();
|
||||
}
|
||||
|
||||
if ( @fclose( $this->file_handle ) === false ) {
|
||||
throw new Ai1wm_Not_Closable_Exception( sprintf( __( 'Unable to close file. File: %s', AI1WM_PLUGIN_NAME ), $this->file_name ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
213
wp-content/plugins/all-in-one-wp-migration/lib/vendor/servmask/archiver/class-ai1wm-compressor.php
vendored
Normal file
213
wp-content/plugins/all-in-one-wp-migration/lib/vendor/servmask/archiver/class-ai1wm-compressor.php
vendored
Normal file
@@ -0,0 +1,213 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2014-2020 ServMask Inc.
|
||||
*
|
||||
* 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/>.
|
||||
*
|
||||
* ███████╗███████╗██████╗ ██╗ ██╗███╗ ███╗ █████╗ ███████╗██╗ ██╗
|
||||
* ██╔════╝██╔════╝██╔══██╗██║ ██║████╗ ████║██╔══██╗██╔════╝██║ ██╔╝
|
||||
* ███████╗█████╗ ██████╔╝██║ ██║██╔████╔██║███████║███████╗█████╔╝
|
||||
* ╚════██║██╔══╝ ██╔══██╗╚██╗ ██╔╝██║╚██╔╝██║██╔══██║╚════██║██╔═██╗
|
||||
* ███████║███████╗██║ ██║ ╚████╔╝ ██║ ╚═╝ ██║██║ ██║███████║██║ ██╗
|
||||
* ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
die( 'Kangaroos cannot jump here' );
|
||||
}
|
||||
|
||||
class Ai1wm_Compressor extends Ai1wm_Archiver {
|
||||
|
||||
/**
|
||||
* Overloaded constructor that opens the passed file for writing
|
||||
*
|
||||
* @param string $file_name File to use as archive
|
||||
*/
|
||||
public function __construct( $file_name ) {
|
||||
parent::__construct( $file_name, true );
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a file to the archive
|
||||
*
|
||||
* @param string $file_name File to add to the archive
|
||||
* @param string $new_file_name Write the file with a different name
|
||||
* @param int $file_written File written (in bytes)
|
||||
* @param int $file_offset File offset (in bytes)
|
||||
*
|
||||
* @throws \Ai1wm_Not_Seekable_Exception
|
||||
* @throws \Ai1wm_Not_Writable_Exception
|
||||
* @throws \Ai1wm_Quota_Exceeded_Exception
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function add_file( $file_name, $new_file_name = '', &$file_written = 0, &$file_offset = 0 ) {
|
||||
$file_written = 0;
|
||||
|
||||
// Replace forward slash with current directory separator in file name
|
||||
$file_name = ai1wm_replace_forward_slash_with_directory_separator( $file_name );
|
||||
|
||||
// Escape Windows directory separator in file name
|
||||
$file_name = ai1wm_escape_windows_directory_separator( $file_name );
|
||||
|
||||
// Flag to hold if file data has been processed
|
||||
$completed = true;
|
||||
|
||||
// Start time
|
||||
$start = microtime( true );
|
||||
|
||||
// Open the file for reading in binary mode (fopen may return null for quarantined files)
|
||||
if ( ( $file_handle = @fopen( $file_name, 'rb' ) ) ) {
|
||||
$file_bytes = 0;
|
||||
|
||||
// Get header block
|
||||
if ( ( $block = $this->get_file_block( $file_name, $new_file_name ) ) ) {
|
||||
|
||||
// Write header block
|
||||
if ( $file_offset === 0 ) {
|
||||
if ( ( $file_bytes = @fwrite( $this->file_handle, $block ) ) !== false ) {
|
||||
if ( strlen( $block ) !== $file_bytes ) {
|
||||
throw new Ai1wm_Quota_Exceeded_Exception( sprintf( __( 'Out of disk space. Unable to write header to file. File: %s', AI1WM_PLUGIN_NAME ), $this->file_name ) );
|
||||
}
|
||||
} else {
|
||||
throw new Ai1wm_Not_Writable_Exception( sprintf( __( 'Unable to write header to file. File: %s', AI1WM_PLUGIN_NAME ), $this->file_name ) );
|
||||
}
|
||||
}
|
||||
|
||||
// Set file offset
|
||||
if ( @fseek( $file_handle, $file_offset, SEEK_SET ) !== -1 ) {
|
||||
|
||||
// Read the file in 512KB chunks
|
||||
while ( false === @feof( $file_handle ) ) {
|
||||
|
||||
// Read the file in chunks of 512KB
|
||||
if ( ( $file_content = @fread( $file_handle, 512000 ) ) !== false ) {
|
||||
if ( ( $file_bytes = @fwrite( $this->file_handle, $file_content ) ) !== false ) {
|
||||
if ( strlen( $file_content ) !== $file_bytes ) {
|
||||
throw new Ai1wm_Quota_Exceeded_Exception( sprintf( __( 'Out of disk space. Unable to write content to file. File: %s', AI1WM_PLUGIN_NAME ), $this->file_name ) );
|
||||
}
|
||||
} else {
|
||||
throw new Ai1wm_Not_Writable_Exception( sprintf( __( 'Unable to write content to file. File: %s', AI1WM_PLUGIN_NAME ), $this->file_name ) );
|
||||
}
|
||||
|
||||
// Set file written
|
||||
$file_written += $file_bytes;
|
||||
}
|
||||
|
||||
// Time elapsed
|
||||
if ( ( $timeout = apply_filters( 'ai1wm_completed_timeout', 10 ) ) ) {
|
||||
if ( ( microtime( true ) - $start ) > $timeout ) {
|
||||
$completed = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Set file offset
|
||||
$file_offset += $file_written;
|
||||
|
||||
// Write file size to file header
|
||||
if ( ( $block = $this->get_file_size_block( $file_offset ) ) ) {
|
||||
|
||||
// Seek to beginning of file size
|
||||
if ( @fseek( $this->file_handle, - $file_offset - 4096 - 12 - 14, SEEK_CUR ) === -1 ) {
|
||||
throw new Ai1wm_Not_Seekable_Exception( __( 'Your PHP is 32-bit. In order to export your file, please change your PHP version to 64-bit and try again. <a href="https://help.servmask.com/knowledgebase/php-32bit/" target="_blank">Technical details</a>', AI1WM_PLUGIN_NAME ) );
|
||||
}
|
||||
|
||||
// Write file size to file header
|
||||
if ( ( $file_bytes = @fwrite( $this->file_handle, $block ) ) !== false ) {
|
||||
if ( strlen( $block ) !== $file_bytes ) {
|
||||
throw new Ai1wm_Quota_Exceeded_Exception( sprintf( __( 'Out of disk space. Unable to write size to file. File: %s', AI1WM_PLUGIN_NAME ), $this->file_name ) );
|
||||
}
|
||||
} else {
|
||||
throw new Ai1wm_Not_Writable_Exception( sprintf( __( 'Unable to write size to file. File: %s', AI1WM_PLUGIN_NAME ), $this->file_name ) );
|
||||
}
|
||||
|
||||
// Seek to end of file content
|
||||
if ( @fseek( $this->file_handle, + $file_offset + 4096 + 12, SEEK_CUR ) === -1 ) {
|
||||
throw new Ai1wm_Not_Seekable_Exception( __( 'Your PHP is 32-bit. In order to export your file, please change your PHP version to 64-bit and try again. <a href="https://help.servmask.com/knowledgebase/php-32bit/" target="_blank">Technical details</a>', AI1WM_PLUGIN_NAME ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Close the handle
|
||||
@fclose( $file_handle );
|
||||
}
|
||||
|
||||
return $completed;
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate binary block header for a file
|
||||
*
|
||||
* @param string $file_name Filename to generate block header for
|
||||
* @param string $new_file_name Write the file with a different name
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
private function get_file_block( $file_name, $new_file_name = '' ) {
|
||||
$block = '';
|
||||
|
||||
// Get stats about the file
|
||||
if ( ( $stat = @stat( $file_name ) ) !== false ) {
|
||||
|
||||
// Filename of the file we are accessing
|
||||
if ( empty( $new_file_name ) ) {
|
||||
$name = ai1wm_basename( $file_name );
|
||||
} else {
|
||||
$name = ai1wm_basename( $new_file_name );
|
||||
}
|
||||
|
||||
// Size in bytes of the file
|
||||
$size = $stat['size'];
|
||||
|
||||
// Last time the file was modified
|
||||
$date = $stat['mtime'];
|
||||
|
||||
// Replace current directory separator with backward slash in file path
|
||||
if ( empty( $new_file_name ) ) {
|
||||
$path = ai1wm_replace_directory_separator_with_forward_slash( ai1wm_dirname( $file_name ) );
|
||||
} else {
|
||||
$path = ai1wm_replace_directory_separator_with_forward_slash( ai1wm_dirname( $new_file_name ) );
|
||||
}
|
||||
|
||||
// Concatenate block format parts
|
||||
$format = implode( '', $this->block_format );
|
||||
|
||||
// Pack file data into binary string
|
||||
$block = pack( $format, $name, $size, $date, $path );
|
||||
}
|
||||
|
||||
return $block;
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate file size binary block header for a file
|
||||
*
|
||||
* @param int $file_size File size
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function get_file_size_block( $file_size ) {
|
||||
$block = '';
|
||||
|
||||
// Pack file data into binary string
|
||||
if ( isset( $this->block_format[1] ) ) {
|
||||
$block = pack( $this->block_format[1], $file_size );
|
||||
}
|
||||
|
||||
return $block;
|
||||
}
|
||||
}
|
||||
605
wp-content/plugins/all-in-one-wp-migration/lib/vendor/servmask/archiver/class-ai1wm-extractor.php
vendored
Normal file
605
wp-content/plugins/all-in-one-wp-migration/lib/vendor/servmask/archiver/class-ai1wm-extractor.php
vendored
Normal file
@@ -0,0 +1,605 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2014-2020 ServMask Inc.
|
||||
*
|
||||
* 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/>.
|
||||
*
|
||||
* ███████╗███████╗██████╗ ██╗ ██╗███╗ ███╗ █████╗ ███████╗██╗ ██╗
|
||||
* ██╔════╝██╔════╝██╔══██╗██║ ██║████╗ ████║██╔══██╗██╔════╝██║ ██╔╝
|
||||
* ███████╗█████╗ ██████╔╝██║ ██║██╔████╔██║███████║███████╗█████╔╝
|
||||
* ╚════██║██╔══╝ ██╔══██╗╚██╗ ██╔╝██║╚██╔╝██║██╔══██║╚════██║██╔═██╗
|
||||
* ███████║███████╗██║ ██║ ╚████╔╝ ██║ ╚═╝ ██║██║ ██║███████║██║ ██╗
|
||||
* ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
die( 'Kangaroos cannot jump here' );
|
||||
}
|
||||
|
||||
class Ai1wm_Extractor extends Ai1wm_Archiver {
|
||||
|
||||
/**
|
||||
* Total files count
|
||||
*
|
||||
* @type int
|
||||
*/
|
||||
protected $total_files_count = null;
|
||||
|
||||
/**
|
||||
* Total files size
|
||||
*
|
||||
* @type int
|
||||
*/
|
||||
protected $total_files_size = null;
|
||||
|
||||
/**
|
||||
* Overloaded constructor that opens the passed file for reading
|
||||
*
|
||||
* @param string $file_name File to use as archive
|
||||
*/
|
||||
public function __construct( $file_name ) {
|
||||
// Call parent, to initialize variables
|
||||
parent::__construct( $file_name );
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the total files count in an archive
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function get_total_files_count() {
|
||||
if ( is_null( $this->total_files_count ) ) {
|
||||
|
||||
// Total files count
|
||||
$this->total_files_count = 0;
|
||||
|
||||
// Total files size
|
||||
$this->total_files_size = 0;
|
||||
|
||||
// Seek to beginning of archive file
|
||||
if ( @fseek( $this->file_handle, 0, SEEK_SET ) === -1 ) {
|
||||
throw new Ai1wm_Not_Seekable_Exception( sprintf( __( 'Unable to seek to beginning of file. File: %s', AI1WM_PLUGIN_NAME ), $this->file_name ) );
|
||||
}
|
||||
|
||||
// Loop over files
|
||||
while ( $block = @fread( $this->file_handle, 4377 ) ) {
|
||||
|
||||
// End block has been reached
|
||||
if ( $block === $this->eof ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Get file data from the block
|
||||
if ( ( $data = $this->get_data_from_block( $block ) ) ) {
|
||||
|
||||
// We have a file, increment the count
|
||||
$this->total_files_count += 1;
|
||||
|
||||
// We have a file, increment the size
|
||||
$this->total_files_size += $data['size'];
|
||||
|
||||
// Skip file content so we can move forward to the next file
|
||||
if ( @fseek( $this->file_handle, $data['size'], SEEK_CUR ) === -1 ) {
|
||||
throw new Ai1wm_Not_Seekable_Exception( sprintf( __( 'Unable to seek to offset of file. File: %s Offset: %d', AI1WM_PLUGIN_NAME ), $this->file_name, $data['size'] ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $this->total_files_count;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the total files size in an archive
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function get_total_files_size() {
|
||||
if ( is_null( $this->total_files_size ) ) {
|
||||
|
||||
// Total files count
|
||||
$this->total_files_count = 0;
|
||||
|
||||
// Total files size
|
||||
$this->total_files_size = 0;
|
||||
|
||||
// Seek to beginning of archive file
|
||||
if ( @fseek( $this->file_handle, 0, SEEK_SET ) === -1 ) {
|
||||
throw new Ai1wm_Not_Seekable_Exception( sprintf( __( 'Unable to seek to beginning of file. File: %s', AI1WM_PLUGIN_NAME ), $this->file_name ) );
|
||||
}
|
||||
|
||||
// Loop over files
|
||||
while ( $block = @fread( $this->file_handle, 4377 ) ) {
|
||||
|
||||
// End block has been reached
|
||||
if ( $block === $this->eof ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Get file data from the block
|
||||
if ( ( $data = $this->get_data_from_block( $block ) ) ) {
|
||||
|
||||
// We have a file, increment the count
|
||||
$this->total_files_count += 1;
|
||||
|
||||
// We have a file, increment the size
|
||||
$this->total_files_size += $data['size'];
|
||||
|
||||
// Skip file content so we can move forward to the next file
|
||||
if ( @fseek( $this->file_handle, $data['size'], SEEK_CUR ) === -1 ) {
|
||||
throw new Ai1wm_Not_Seekable_Exception( sprintf( __( 'Unable to seek to offset of file. File: %s Offset: %d', AI1WM_PLUGIN_NAME ), $this->file_name, $data['size'] ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $this->total_files_size;
|
||||
}
|
||||
|
||||
/**
|
||||
* Extract one file to location
|
||||
*
|
||||
* @param string $location Destination path
|
||||
* @param array $exclude_files Exclude files by name
|
||||
* @param array $exclude_extensions Exclude files by extension
|
||||
* @param array $old_paths Old replace paths
|
||||
* @param array $new_paths New replace paths
|
||||
* @param int $file_written File written (in bytes)
|
||||
* @param int $file_offset File offset (in bytes)
|
||||
*
|
||||
* @throws \Ai1wm_Not_Directory_Exception
|
||||
* @throws \Ai1wm_Not_Seekable_Exception
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function extract_one_file_to( $location, $exclude_files = array(), $exclude_extensions = array(), $old_paths = array(), $new_paths = array(), &$file_written = 0, &$file_offset = 0 ) {
|
||||
if ( false === is_dir( $location ) ) {
|
||||
throw new Ai1wm_Not_Directory_Exception( sprintf( __( 'Location is not a directory: %s', AI1WM_PLUGIN_NAME ), $location ) );
|
||||
}
|
||||
|
||||
// Replace forward slash with current directory separator in location
|
||||
$location = ai1wm_replace_forward_slash_with_directory_separator( $location );
|
||||
|
||||
// Flag to hold if file data has been processed
|
||||
$completed = true;
|
||||
|
||||
// Seek to file offset to archive file
|
||||
if ( $file_offset > 0 ) {
|
||||
if ( @fseek( $this->file_handle, - $file_offset - 4377, SEEK_CUR ) === -1 ) {
|
||||
throw new Ai1wm_Not_Seekable_Exception( sprintf( __( 'Unable to seek to offset of file. File: %s Offset: %d', AI1WM_PLUGIN_NAME ), $this->file_name, - $file_offset - 4377 ) );
|
||||
}
|
||||
}
|
||||
|
||||
// Read file header block
|
||||
if ( ( $block = @fread( $this->file_handle, 4377 ) ) ) {
|
||||
|
||||
// We reached end of file, set the pointer to the end of the file so that feof returns true
|
||||
if ( $block === $this->eof ) {
|
||||
|
||||
// Seek to end of archive file minus 1 byte
|
||||
@fseek( $this->file_handle, 1, SEEK_END );
|
||||
|
||||
// Read 1 character
|
||||
@fgetc( $this->file_handle );
|
||||
|
||||
} else {
|
||||
|
||||
// Get file header data from the block
|
||||
if ( ( $data = $this->get_data_from_block( $block ) ) ) {
|
||||
|
||||
// Set file name
|
||||
$file_name = $data['filename'];
|
||||
|
||||
// Set file size
|
||||
$file_size = $data['size'];
|
||||
|
||||
// Set file mtime
|
||||
$file_mtime = $data['mtime'];
|
||||
|
||||
// Set file path
|
||||
$file_path = $data['path'];
|
||||
|
||||
// Set should exclude file
|
||||
$should_exclude_file = false;
|
||||
|
||||
// Should we skip this file by name?
|
||||
for ( $i = 0; $i < count( $exclude_files ); $i++ ) {
|
||||
if ( strpos( $file_name . DIRECTORY_SEPARATOR, ai1wm_replace_forward_slash_with_directory_separator( $exclude_files[ $i ] ) . DIRECTORY_SEPARATOR ) === 0 ) {
|
||||
$should_exclude_file = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Should we skip this file by extension?
|
||||
for ( $i = 0; $i < count( $exclude_extensions ); $i++ ) {
|
||||
if ( strrpos( $file_name, $exclude_extensions[ $i ] ) === strlen( $file_name ) - strlen( $exclude_extensions[ $i ] ) ) {
|
||||
$should_exclude_file = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Do we have a match?
|
||||
if ( $should_exclude_file === false ) {
|
||||
|
||||
// Replace extract paths
|
||||
for ( $i = 0; $i < count( $old_paths ); $i++ ) {
|
||||
if ( strpos( $file_path . DIRECTORY_SEPARATOR, ai1wm_replace_forward_slash_with_directory_separator( $old_paths[ $i ] ) . DIRECTORY_SEPARATOR ) === 0 ) {
|
||||
$file_name = substr_replace( $file_name, ai1wm_replace_forward_slash_with_directory_separator( $new_paths[ $i ] ), 0, strlen( ai1wm_replace_forward_slash_with_directory_separator( $old_paths[ $i ] ) ) );
|
||||
$file_path = substr_replace( $file_path, ai1wm_replace_forward_slash_with_directory_separator( $new_paths[ $i ] ), 0, strlen( ai1wm_replace_forward_slash_with_directory_separator( $old_paths[ $i ] ) ) );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Escape Windows directory separator in file path
|
||||
if ( path_is_absolute( $file_path ) ) {
|
||||
$file_path = ai1wm_escape_windows_directory_separator( $file_path );
|
||||
} else {
|
||||
$file_path = ai1wm_escape_windows_directory_separator( $location . DIRECTORY_SEPARATOR . $file_path );
|
||||
}
|
||||
|
||||
// Escape Windows directory separator in file name
|
||||
if ( path_is_absolute( $file_name ) ) {
|
||||
$file_name = ai1wm_escape_windows_directory_separator( $file_name );
|
||||
} else {
|
||||
$file_name = ai1wm_escape_windows_directory_separator( $location . DIRECTORY_SEPARATOR . $file_name );
|
||||
}
|
||||
|
||||
// Check if location doesn't exist, then create it
|
||||
if ( false === is_dir( $file_path ) ) {
|
||||
@mkdir( $file_path, $this->get_permissions_for_directory(), true );
|
||||
}
|
||||
|
||||
$file_written = 0;
|
||||
|
||||
// We have a match, let's extract the file
|
||||
if ( ( $completed = $this->extract_to( $file_name, $file_size, $file_mtime, $file_written, $file_offset ) ) ) {
|
||||
$file_offset = 0;
|
||||
}
|
||||
} else {
|
||||
|
||||
// We don't have a match, skip file content
|
||||
if ( @fseek( $this->file_handle, $file_size, SEEK_CUR ) === -1 ) {
|
||||
throw new Ai1wm_Not_Seekable_Exception( sprintf( __( 'Unable to seek to offset of file. File: %s Offset: %d', AI1WM_PLUGIN_NAME ), $this->file_name, $file_size ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $completed;
|
||||
}
|
||||
|
||||
/**
|
||||
* Extract specific files from archive
|
||||
*
|
||||
* @param string $location Location where to extract files
|
||||
* @param array $include_files Include files by name
|
||||
* @param array $exclude_files Exclude files by name
|
||||
* @param array $exclude_extensions Exclude files by extension
|
||||
* @param int $file_written File written (in bytes)
|
||||
* @param int $file_offset File offset (in bytes)
|
||||
*
|
||||
* @throws \Ai1wm_Not_Directory_Exception
|
||||
* @throws \Ai1wm_Not_Seekable_Exception
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function extract_by_files_array( $location, $include_files = array(), $exclude_files = array(), $exclude_extensions = array(), &$file_written = 0, &$file_offset = 0 ) {
|
||||
if ( false === is_dir( $location ) ) {
|
||||
throw new Ai1wm_Not_Directory_Exception( sprintf( __( 'Location is not a directory: %s', AI1WM_PLUGIN_NAME ), $location ) );
|
||||
}
|
||||
|
||||
// Replace forward slash with current directory separator in location
|
||||
$location = ai1wm_replace_forward_slash_with_directory_separator( $location );
|
||||
|
||||
// Flag to hold if file data has been processed
|
||||
$completed = true;
|
||||
|
||||
// Start time
|
||||
$start = microtime( true );
|
||||
|
||||
// Seek to file offset to archive file
|
||||
if ( $file_offset > 0 ) {
|
||||
if ( @fseek( $this->file_handle, - $file_offset - 4377, SEEK_CUR ) === -1 ) {
|
||||
throw new Ai1wm_Not_Seekable_Exception( sprintf( __( 'Unable to seek to offset of file. File: %s Offset: %d', AI1WM_PLUGIN_NAME ), $this->file_name, - $file_offset - 4377 ) );
|
||||
}
|
||||
}
|
||||
|
||||
// We read until we reached the end of the file, or the files we were looking for were found
|
||||
while ( ( $block = @fread( $this->file_handle, 4377 ) ) ) {
|
||||
|
||||
// We reached end of file, set the pointer to the end of the file so that feof returns true
|
||||
if ( $block === $this->eof ) {
|
||||
|
||||
// Seek to end of archive file minus 1 byte
|
||||
@fseek( $this->file_handle, 1, SEEK_END );
|
||||
|
||||
// Read 1 character
|
||||
@fgetc( $this->file_handle );
|
||||
|
||||
} else {
|
||||
|
||||
// Get file header data from the block
|
||||
if ( ( $data = $this->get_data_from_block( $block ) ) ) {
|
||||
|
||||
// Set file name
|
||||
$file_name = $data['filename'];
|
||||
|
||||
// Set file size
|
||||
$file_size = $data['size'];
|
||||
|
||||
// Set file mtime
|
||||
$file_mtime = $data['mtime'];
|
||||
|
||||
// Set file path
|
||||
$file_path = $data['path'];
|
||||
|
||||
// Set should include file
|
||||
$should_include_file = false;
|
||||
|
||||
// Should we extract this file by name?
|
||||
for ( $i = 0; $i < count( $include_files ); $i++ ) {
|
||||
if ( strpos( $file_name . DIRECTORY_SEPARATOR, ai1wm_replace_forward_slash_with_directory_separator( $include_files[ $i ] ) . DIRECTORY_SEPARATOR ) === 0 ) {
|
||||
$should_include_file = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Should we skip this file name?
|
||||
for ( $i = 0; $i < count( $exclude_files ); $i++ ) {
|
||||
if ( strpos( $file_name . DIRECTORY_SEPARATOR, ai1wm_replace_forward_slash_with_directory_separator( $exclude_files[ $i ] ) . DIRECTORY_SEPARATOR ) === 0 ) {
|
||||
$should_include_file = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Should we skip this file by extension?
|
||||
for ( $i = 0; $i < count( $exclude_extensions ); $i++ ) {
|
||||
if ( strrpos( $file_name, $exclude_extensions[ $i ] ) === strlen( $file_name ) - strlen( $exclude_extensions[ $i ] ) ) {
|
||||
$should_include_file = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Do we have a match?
|
||||
if ( $should_include_file === true ) {
|
||||
|
||||
// Escape Windows directory separator in file path
|
||||
$file_path = ai1wm_escape_windows_directory_separator( $location . DIRECTORY_SEPARATOR . $file_path );
|
||||
|
||||
// Escape Windows directory separator in file name
|
||||
$file_name = ai1wm_escape_windows_directory_separator( $location . DIRECTORY_SEPARATOR . $file_name );
|
||||
|
||||
// Check if location doesn't exist, then create it
|
||||
if ( false === is_dir( $file_path ) ) {
|
||||
@mkdir( $file_path, $this->get_permissions_for_directory(), true );
|
||||
}
|
||||
|
||||
$file_written = 0;
|
||||
|
||||
// We have a match, let's extract the file and remove it from the array
|
||||
if ( ( $completed = $this->extract_to( $file_name, $file_size, $file_mtime, $file_written, $file_offset ) ) ) {
|
||||
$file_offset = 0;
|
||||
}
|
||||
} else {
|
||||
|
||||
// We don't have a match, skip file content
|
||||
if ( @fseek( $this->file_handle, $file_size, SEEK_CUR ) === -1 ) {
|
||||
throw new Ai1wm_Not_Seekable_Exception( sprintf( __( 'Unable to seek to offset of file. File: %s Offset: %d', AI1WM_PLUGIN_NAME ), $this->file_name, $file_size ) );
|
||||
}
|
||||
}
|
||||
|
||||
// Time elapsed
|
||||
if ( ( $timeout = apply_filters( 'ai1wm_completed_timeout', 10 ) ) ) {
|
||||
if ( ( microtime( true ) - $start ) > $timeout ) {
|
||||
$completed = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $completed;
|
||||
}
|
||||
|
||||
/**
|
||||
* Extract file to
|
||||
*
|
||||
* @param string $file_name File name
|
||||
* @param array $file_size File size (in bytes)
|
||||
* @param array $file_mtime File modified time (in seconds)
|
||||
* @param int $file_written File written (in bytes)
|
||||
* @param int $file_offset File offset (in bytes)
|
||||
*
|
||||
* @throws \Ai1wm_Not_Seekable_Exception
|
||||
* @throws \Ai1wm_Not_Readable_Exception
|
||||
* @throws \Ai1wm_Quota_Exceeded_Exception
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
private function extract_to( $file_name, $file_size, $file_mtime, &$file_written = 0, &$file_offset = 0 ) {
|
||||
$file_written = 0;
|
||||
|
||||
// Flag to hold if file data has been processed
|
||||
$completed = true;
|
||||
|
||||
// Start time
|
||||
$start = microtime( true );
|
||||
|
||||
// Seek to file offset to archive file
|
||||
if ( $file_offset > 0 ) {
|
||||
if ( @fseek( $this->file_handle, $file_offset, SEEK_CUR ) === -1 ) {
|
||||
throw new Ai1wm_Not_Seekable_Exception( sprintf( __( 'Unable to seek to offset of file. File: %s Offset: %d', AI1WM_PLUGIN_NAME ), $this->file_name, $file_size ) );
|
||||
}
|
||||
}
|
||||
|
||||
// Set file size
|
||||
$file_size -= $file_offset;
|
||||
|
||||
// Should the extract overwrite the file if it exists? (fopen may return null for quarantined files)
|
||||
if ( ( $file_handle = @fopen( $file_name, ( $file_offset === 0 ? 'wb' : 'ab' ) ) ) ) {
|
||||
$file_bytes = 0;
|
||||
|
||||
// Is the filesize more than 0 bytes?
|
||||
while ( $file_size > 0 ) {
|
||||
|
||||
// Read the file in chunks of 512KB
|
||||
$chunk_size = $file_size > 512000 ? 512000 : $file_size;
|
||||
|
||||
// Read data chunk by chunk from archive file
|
||||
if ( $chunk_size > 0 ) {
|
||||
$file_content = null;
|
||||
|
||||
// Read the file in chunks of 512KB from archiver
|
||||
if ( ( $file_content = @fread( $this->file_handle, $chunk_size ) ) === false ) {
|
||||
throw new Ai1wm_Not_Readable_Exception( sprintf( __( 'Unable to read content from file. File: %s', AI1WM_PLUGIN_NAME ), $this->file_name ) );
|
||||
}
|
||||
|
||||
// Remove the amount of bytes we read
|
||||
$file_size -= $chunk_size;
|
||||
|
||||
// Write file contents
|
||||
if ( ( $file_bytes = @fwrite( $file_handle, $file_content ) ) !== false ) {
|
||||
if ( strlen( $file_content ) !== $file_bytes ) {
|
||||
throw new Ai1wm_Quota_Exceeded_Exception( sprintf( __( 'Out of disk space. Unable to write content to file. File: %s', AI1WM_PLUGIN_NAME ), $file_name ) );
|
||||
}
|
||||
}
|
||||
|
||||
// Set file written
|
||||
$file_written += $chunk_size;
|
||||
}
|
||||
|
||||
// Time elapsed
|
||||
if ( ( $timeout = apply_filters( 'ai1wm_completed_timeout', 10 ) ) ) {
|
||||
if ( ( microtime( true ) - $start ) > $timeout ) {
|
||||
$completed = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Set file offset
|
||||
$file_offset += $file_written;
|
||||
|
||||
// Close the handle
|
||||
@fclose( $file_handle );
|
||||
|
||||
// Let's apply last modified date
|
||||
@touch( $file_name, $file_mtime );
|
||||
|
||||
// All files should chmoded to 644
|
||||
@chmod( $file_name, $this->get_permissions_for_file() );
|
||||
|
||||
} else {
|
||||
|
||||
// We don't have file permissions, skip file content
|
||||
if ( @fseek( $this->file_handle, $file_size, SEEK_CUR ) === -1 ) {
|
||||
throw new Ai1wm_Not_Seekable_Exception( sprintf( __( 'Unable to seek to offset of file. File: %s Offset: %d', AI1WM_PLUGIN_NAME ), $this->file_name, $file_size ) );
|
||||
}
|
||||
}
|
||||
|
||||
return $completed;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get file header data from the block
|
||||
*
|
||||
* @param string $block Binary file header
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
private function get_data_from_block( $block ) {
|
||||
$data = false;
|
||||
|
||||
// prepare our array keys to unpack
|
||||
$format = array(
|
||||
$this->block_format[0] . 'filename/',
|
||||
$this->block_format[1] . 'size/',
|
||||
$this->block_format[2] . 'mtime/',
|
||||
$this->block_format[3] . 'path',
|
||||
);
|
||||
$format = implode( '', $format );
|
||||
|
||||
// Unpack file header data
|
||||
if ( ( $data = unpack( $format, $block ) ) ) {
|
||||
|
||||
// Set file details
|
||||
$data['filename'] = trim( $data['filename'] );
|
||||
$data['size'] = trim( $data['size'] );
|
||||
$data['mtime'] = trim( $data['mtime'] );
|
||||
$data['path'] = trim( $data['path'] );
|
||||
|
||||
// Set file name
|
||||
$data['filename'] = ( $data['path'] === '.' ? $data['filename'] : $data['path'] . DIRECTORY_SEPARATOR . $data['filename'] );
|
||||
|
||||
// Set file path
|
||||
$data['path'] = ( $data['path'] === '.' ? '' : $data['path'] );
|
||||
|
||||
// Replace forward slash with current directory separator in file name
|
||||
$data['filename'] = ai1wm_replace_forward_slash_with_directory_separator( $data['filename'] );
|
||||
|
||||
// Replace forward slash with current directory separator in file path
|
||||
$data['path'] = ai1wm_replace_forward_slash_with_directory_separator( $data['path'] );
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if file has reached end of file
|
||||
* Returns true if file has reached eof, false otherwise
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function has_reached_eof() {
|
||||
return @feof( $this->file_handle );
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if file has reached end of file
|
||||
* Returns true if file has NOT reached eof, false otherwise
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function has_not_reached_eof() {
|
||||
return ! @feof( $this->file_handle );
|
||||
}
|
||||
|
||||
/**
|
||||
* Get directory permissions
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function get_permissions_for_directory() {
|
||||
if ( defined( 'FS_CHMOD_DIR' ) ) {
|
||||
return FS_CHMOD_DIR;
|
||||
}
|
||||
|
||||
return 0755;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get file permissions
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function get_permissions_for_file() {
|
||||
if ( defined( 'FS_CHMOD_FILE' ) ) {
|
||||
return FS_CHMOD_FILE;
|
||||
}
|
||||
|
||||
return 0644;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2014-2020 ServMask Inc.
|
||||
*
|
||||
* 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/>.
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
die( 'Kangaroos cannot jump here' );
|
||||
}
|
||||
|
||||
if ( defined( 'WP_CLI' ) ) {
|
||||
class Ai1wm_WP_CLI_Command extends WP_CLI_Command {
|
||||
public function __invoke() {
|
||||
if ( is_multisite() ) {
|
||||
WP_CLI::error_multi_line(
|
||||
array(
|
||||
__( 'WordPress Multisite is supported via our All-in-One WP Migration Multisite Extension.', AI1WM_PLUGIN_NAME ),
|
||||
__( 'You can get a copy of it here: https://servmask.com/products/multisite-extension', AI1WM_PLUGIN_NAME ),
|
||||
)
|
||||
);
|
||||
exit;
|
||||
}
|
||||
|
||||
WP_CLI::error_multi_line(
|
||||
array(
|
||||
__( 'WordPress CLI is supported via our All-in-One WP Migration Unlimited Extension.', AI1WM_PLUGIN_NAME ),
|
||||
__( 'You can get a copy of it here: https://servmask.com/products/unlimited-extension', AI1WM_PLUGIN_NAME ),
|
||||
)
|
||||
);
|
||||
exit;
|
||||
}
|
||||
}
|
||||
}
|
||||
111
wp-content/plugins/all-in-one-wp-migration/lib/vendor/servmask/cron/class-ai1wm-cron.php
vendored
Normal file
111
wp-content/plugins/all-in-one-wp-migration/lib/vendor/servmask/cron/class-ai1wm-cron.php
vendored
Normal file
@@ -0,0 +1,111 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2014-2020 ServMask Inc.
|
||||
*
|
||||
* 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/>.
|
||||
*
|
||||
* ███████╗███████╗██████╗ ██╗ ██╗███╗ ███╗ █████╗ ███████╗██╗ ██╗
|
||||
* ██╔════╝██╔════╝██╔══██╗██║ ██║████╗ ████║██╔══██╗██╔════╝██║ ██╔╝
|
||||
* ███████╗█████╗ ██████╔╝██║ ██║██╔████╔██║███████║███████╗█████╔╝
|
||||
* ╚════██║██╔══╝ ██╔══██╗╚██╗ ██╔╝██║╚██╔╝██║██╔══██║╚════██║██╔═██╗
|
||||
* ███████║███████╗██║ ██║ ╚████╔╝ ██║ ╚═╝ ██║██║ ██║███████║██║ ██╗
|
||||
* ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
die( 'Kangaroos cannot jump here' );
|
||||
}
|
||||
|
||||
class Ai1wm_Cron {
|
||||
|
||||
/**
|
||||
* Schedules a hook which will be executed by the WordPress
|
||||
* actions core on a specific interval
|
||||
*
|
||||
* @param string $hook Event hook
|
||||
* @param string $recurrence How often the event should reoccur
|
||||
* @param integer $timestamp Preferred timestamp (when the event shall be run)
|
||||
* @param array $args Arguments to pass to the hook function(s)
|
||||
* @return mixed
|
||||
*/
|
||||
public static function add( $hook, $recurrence, $timestamp, $args = array() ) {
|
||||
$schedules = wp_get_schedules();
|
||||
|
||||
// Schedule event
|
||||
if ( isset( $schedules[ $recurrence ] ) && ( $current = $schedules[ $recurrence ] ) ) {
|
||||
if ( $timestamp <= ( $current_timestamp = time() ) ) {
|
||||
while ( $timestamp <= $current_timestamp ) {
|
||||
$timestamp += $current['interval'];
|
||||
}
|
||||
}
|
||||
|
||||
return wp_schedule_event( $timestamp, $recurrence, $hook, $args );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Un-schedules all previously-scheduled cron jobs using a particular
|
||||
* hook name or a specific combination of hook name and arguments.
|
||||
*
|
||||
* @param string $hook Event hook
|
||||
* @return boolean
|
||||
*/
|
||||
public static function clear( $hook ) {
|
||||
$cron = get_option( AI1WM_CRON, array() );
|
||||
if ( empty( $cron ) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
foreach ( $cron as $timestamp => $hooks ) {
|
||||
if ( isset( $hooks[ $hook ] ) ) {
|
||||
unset( $cron[ $timestamp ][ $hook ] );
|
||||
|
||||
// Unset empty timestamps
|
||||
if ( empty( $cron[ $timestamp ] ) ) {
|
||||
unset( $cron[ $timestamp ] );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return update_option( AI1WM_CRON, $cron );
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks whether cronjob already exists
|
||||
*
|
||||
* @param string $hook Event hook
|
||||
* @param array $args Event callback arguments
|
||||
* @return boolean
|
||||
*/
|
||||
public static function exists( $hook, $args = array() ) {
|
||||
$cron = get_option( AI1WM_CRON, array() );
|
||||
if ( empty( $cron ) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
foreach ( $cron as $timestamp => $hooks ) {
|
||||
if ( empty( $args ) ) {
|
||||
if ( isset( $hooks[ $hook ] ) ) {
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
if ( isset( $hooks[ $hook ][ md5( serialize( $args ) ) ] ) ) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,140 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2014-2020 ServMask Inc.
|
||||
*
|
||||
* 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/>.
|
||||
*
|
||||
* ███████╗███████╗██████╗ ██╗ ██╗███╗ ███╗ █████╗ ███████╗██╗ ██╗
|
||||
* ██╔════╝██╔════╝██╔══██╗██║ ██║████╗ ████║██╔══██╗██╔════╝██║ ██╔╝
|
||||
* ███████╗█████╗ ██████╔╝██║ ██║██╔████╔██║███████║███████╗█████╔╝
|
||||
* ╚════██║██╔══╝ ██╔══██╗╚██╗ ██╔╝██║╚██╔╝██║██╔══██║╚════██║██╔═██╗
|
||||
* ███████║███████╗██║ ██║ ╚████╔╝ ██║ ╚═╝ ██║██║ ██║███████║██║ ██╗
|
||||
* ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
die( 'Kangaroos cannot jump here' );
|
||||
}
|
||||
|
||||
class Ai1wm_Database_Mysql extends Ai1wm_Database {
|
||||
|
||||
/**
|
||||
* Run MySQL query
|
||||
*
|
||||
* @param string $input SQL query
|
||||
* @return mixed
|
||||
*/
|
||||
public function query( $input ) {
|
||||
if ( ! ( $result = mysql_query( $input, $this->wpdb->dbh ) ) ) {
|
||||
$mysql_errno = 0;
|
||||
|
||||
// Get MySQL error code
|
||||
if ( ! empty( $this->wpdb->dbh ) ) {
|
||||
if ( is_resource( $this->wpdb->dbh ) ) {
|
||||
$mysql_errno = mysql_errno( $this->wpdb->dbh );
|
||||
} else {
|
||||
$mysql_errno = 2006;
|
||||
}
|
||||
}
|
||||
|
||||
// MySQL server has gone away, try to reconnect
|
||||
if ( empty( $this->wpdb->dbh ) || 2006 === $mysql_errno ) {
|
||||
if ( ! $this->wpdb->check_connection( false ) ) {
|
||||
throw new Ai1wm_Database_Exception( __( 'Error reconnecting to the database. <a href="https://help.servmask.com/knowledgebase/mysql-error-reconnecting/" target="_blank">Technical details</a>', AI1WM_PLUGIN_NAME ), 503 );
|
||||
}
|
||||
|
||||
$result = mysql_query( $input, $this->wpdb->dbh );
|
||||
}
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Escape string input for mysql query
|
||||
*
|
||||
* @param string $input String to escape
|
||||
* @return string
|
||||
*/
|
||||
public function escape( $input ) {
|
||||
return mysql_real_escape_string( $input, $this->wpdb->dbh );
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the error code for the most recent function call
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public function errno() {
|
||||
return mysql_errno( $this->wpdb->dbh );
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a string description of the last error
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function error() {
|
||||
return mysql_error( $this->wpdb->dbh );
|
||||
}
|
||||
|
||||
/**
|
||||
* Return server version
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function version() {
|
||||
return mysql_get_server_info( $this->wpdb->dbh );
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the result from MySQL query as associative array
|
||||
*
|
||||
* @param resource $result MySQL resource
|
||||
* @return array
|
||||
*/
|
||||
public function fetch_assoc( $result ) {
|
||||
return mysql_fetch_assoc( $result );
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the result from MySQL query as row
|
||||
*
|
||||
* @param resource $result MySQL resource
|
||||
* @return array
|
||||
*/
|
||||
public function fetch_row( $result ) {
|
||||
return mysql_fetch_row( $result );
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the number for rows from MySQL results
|
||||
*
|
||||
* @param resource $result MySQL resource
|
||||
* @return integer
|
||||
*/
|
||||
public function num_rows( $result ) {
|
||||
return mysql_num_rows( $result );
|
||||
}
|
||||
|
||||
/**
|
||||
* Free MySQL result memory
|
||||
*
|
||||
* @param resource $result MySQL resource
|
||||
* @return boolean
|
||||
*/
|
||||
public function free_result( $result ) {
|
||||
return mysql_free_result( $result );
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,145 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2014-2020 ServMask Inc.
|
||||
*
|
||||
* 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/>.
|
||||
*
|
||||
* ███████╗███████╗██████╗ ██╗ ██╗███╗ ███╗ █████╗ ███████╗██╗ ██╗
|
||||
* ██╔════╝██╔════╝██╔══██╗██║ ██║████╗ ████║██╔══██╗██╔════╝██║ ██╔╝
|
||||
* ███████╗█████╗ ██████╔╝██║ ██║██╔████╔██║███████║███████╗█████╔╝
|
||||
* ╚════██║██╔══╝ ██╔══██╗╚██╗ ██╔╝██║╚██╔╝██║██╔══██║╚════██║██╔═██╗
|
||||
* ███████║███████╗██║ ██║ ╚████╔╝ ██║ ╚═╝ ██║██║ ██║███████║██║ ██╗
|
||||
* ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
die( 'Kangaroos cannot jump here' );
|
||||
}
|
||||
|
||||
class Ai1wm_Database_Mysqli extends Ai1wm_Database {
|
||||
|
||||
/**
|
||||
* Run MySQL query
|
||||
*
|
||||
* @param string $input SQL query
|
||||
* @return mixed
|
||||
*/
|
||||
public function query( $input ) {
|
||||
if ( ! mysqli_real_query( $this->wpdb->dbh, $input ) ) {
|
||||
$mysqli_errno = 0;
|
||||
|
||||
// Get MySQL error code
|
||||
if ( ! empty( $this->wpdb->dbh ) ) {
|
||||
if ( $this->wpdb->dbh instanceof mysqli ) {
|
||||
$mysqli_errno = mysqli_errno( $this->wpdb->dbh );
|
||||
} else {
|
||||
$mysqli_errno = 2006;
|
||||
}
|
||||
}
|
||||
|
||||
// MySQL server has gone away, try to reconnect
|
||||
if ( empty( $this->wpdb->dbh ) || 2006 === $mysqli_errno ) {
|
||||
if ( ! $this->wpdb->check_connection( false ) ) {
|
||||
throw new Ai1wm_Database_Exception( __( 'Error reconnecting to the database. <a href="https://help.servmask.com/knowledgebase/mysql-error-reconnecting/" target="_blank">Technical details</a>', AI1WM_PLUGIN_NAME ), 503 );
|
||||
}
|
||||
|
||||
mysqli_real_query( $this->wpdb->dbh, $input );
|
||||
}
|
||||
}
|
||||
|
||||
// Copy results from the internal mysqlnd buffer into the PHP variables fetched
|
||||
if ( defined( 'MYSQLI_STORE_RESULT_COPY_DATA' ) ) {
|
||||
return mysqli_store_result( $this->wpdb->dbh, MYSQLI_STORE_RESULT_COPY_DATA );
|
||||
}
|
||||
|
||||
return mysqli_store_result( $this->wpdb->dbh );
|
||||
}
|
||||
|
||||
/**
|
||||
* Escape string input for mysql query
|
||||
*
|
||||
* @param string $input String to escape
|
||||
* @return string
|
||||
*/
|
||||
public function escape( $input ) {
|
||||
return mysqli_real_escape_string( $this->wpdb->dbh, $input );
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the error code for the most recent function call
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public function errno() {
|
||||
return mysqli_errno( $this->wpdb->dbh );
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a string description of the last error
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function error() {
|
||||
return mysqli_error( $this->wpdb->dbh );
|
||||
}
|
||||
|
||||
/**
|
||||
* Return server version
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function version() {
|
||||
return mysqli_get_server_info( $this->wpdb->dbh );
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the result from MySQL query as associative array
|
||||
*
|
||||
* @param resource $result MySQL resource
|
||||
* @return array
|
||||
*/
|
||||
public function fetch_assoc( $result ) {
|
||||
return mysqli_fetch_assoc( $result );
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the result from MySQL query as row
|
||||
*
|
||||
* @param resource $result MySQL resource
|
||||
* @return array
|
||||
*/
|
||||
public function fetch_row( $result ) {
|
||||
return mysqli_fetch_row( $result );
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the number for rows from MySQL results
|
||||
*
|
||||
* @param resource $result MySQL resource
|
||||
* @return integer
|
||||
*/
|
||||
public function num_rows( $result ) {
|
||||
return mysqli_num_rows( $result );
|
||||
}
|
||||
|
||||
/**
|
||||
* Free MySQL result memory
|
||||
*
|
||||
* @param resource $result MySQL resource
|
||||
* @return boolean
|
||||
*/
|
||||
public function free_result( $result ) {
|
||||
return mysqli_free_result( $result );
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,165 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2014-2020 ServMask Inc.
|
||||
*
|
||||
* 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/>.
|
||||
*
|
||||
* ███████╗███████╗██████╗ ██╗ ██╗███╗ ███╗ █████╗ ███████╗██╗ ██╗
|
||||
* ██╔════╝██╔════╝██╔══██╗██║ ██║████╗ ████║██╔══██╗██╔════╝██║ ██╔╝
|
||||
* ███████╗█████╗ ██████╔╝██║ ██║██╔████╔██║███████║███████╗█████╔╝
|
||||
* ╚════██║██╔══╝ ██╔══██╗╚██╗ ██╔╝██║╚██╔╝██║██╔══██║╚════██║██╔═██╗
|
||||
* ███████║███████╗██║ ██║ ╚████╔╝ ██║ ╚═╝ ██║██║ ██║███████║██║ ██╗
|
||||
* ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
die( 'Kangaroos cannot jump here' );
|
||||
}
|
||||
|
||||
class Ai1wm_Database_Utility {
|
||||
|
||||
/**
|
||||
* Replace all occurrences of the search string with the replacement string.
|
||||
* This function is case-sensitive.
|
||||
*
|
||||
* @param array $from List of string we're looking to replace.
|
||||
* @param array $to What we want it to be replaced with.
|
||||
* @param string $data Data to replace.
|
||||
* @return mixed The original string with all elements replaced as needed.
|
||||
*/
|
||||
public static function replace_values( $from = array(), $to = array(), $data = '' ) {
|
||||
if ( ! empty( $from ) && ! empty( $to ) ) {
|
||||
return strtr( $data, array_combine( $from, $to ) );
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Take a serialized array and unserialize it replacing elements as needed and
|
||||
* unserializing any subordinate arrays and performing the replace on those too.
|
||||
* This function is case-sensitive.
|
||||
*
|
||||
* @param array $from List of string we're looking to replace.
|
||||
* @param array $to What we want it to be replaced with.
|
||||
* @param mixed $data Used to pass any subordinate arrays back to in.
|
||||
* @param bool $serialized Does the array passed via $data need serializing.
|
||||
* @return mixed The original array with all elements replaced as needed.
|
||||
*/
|
||||
public static function replace_serialized_values( $from = array(), $to = array(), $data = '', $serialized = false ) {
|
||||
try {
|
||||
|
||||
// Some unserialized data cannot be re-serialized eg. SimpleXMLElements
|
||||
if ( is_serialized( $data ) && ( $unserialized = @unserialize( $data ) ) !== false ) {
|
||||
$data = self::replace_serialized_values( $from, $to, $unserialized, true );
|
||||
} elseif ( is_array( $data ) ) {
|
||||
$tmp = array();
|
||||
foreach ( $data as $key => $value ) {
|
||||
$tmp[ $key ] = self::replace_serialized_values( $from, $to, $value, false );
|
||||
}
|
||||
|
||||
$data = $tmp;
|
||||
unset( $tmp );
|
||||
} elseif ( is_object( $data ) ) {
|
||||
if ( ! ( $data instanceof __PHP_Incomplete_Class ) ) {
|
||||
$tmp = $data;
|
||||
$props = get_object_vars( $data );
|
||||
foreach ( $props as $key => $value ) {
|
||||
if ( ! empty( $tmp->$key ) ) {
|
||||
$tmp->$key = self::replace_serialized_values( $from, $to, $value, false );
|
||||
}
|
||||
}
|
||||
|
||||
$data = $tmp;
|
||||
unset( $tmp );
|
||||
}
|
||||
} else {
|
||||
if ( is_string( $data ) ) {
|
||||
if ( ! empty( $from ) && ! empty( $to ) ) {
|
||||
$data = strtr( $data, array_combine( $from, $to ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( $serialized ) {
|
||||
return serialize( $data );
|
||||
}
|
||||
} catch ( Exception $e ) {
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Escape MySQL special characters
|
||||
*
|
||||
* @param string $data Data to escape
|
||||
* @return string
|
||||
*/
|
||||
public static function escape_mysql( $data ) {
|
||||
return strtr(
|
||||
$data,
|
||||
array_combine(
|
||||
array( "\x00", "\n", "\r", '\\', "'", '"', "\x1a" ),
|
||||
array( '\\0', '\\n', '\\r', '\\\\', "\\'", '\\"', '\\Z' )
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Unescape MySQL special characters
|
||||
*
|
||||
* @param string $data Data to unescape
|
||||
* @return string
|
||||
*/
|
||||
public static function unescape_mysql( $data ) {
|
||||
return strtr(
|
||||
$data,
|
||||
array_combine(
|
||||
array( '\\0', '\\n', '\\r', '\\\\', "\\'", '\\"', '\\Z' ),
|
||||
array( "\x00", "\n", "\r", '\\', "'", '"', "\x1a" )
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Encode base64 characters
|
||||
*
|
||||
* @param string $data Data to encode
|
||||
* @return string
|
||||
*/
|
||||
public static function base64_encode( $data ) {
|
||||
return base64_encode( $data );
|
||||
}
|
||||
|
||||
/**
|
||||
* Encode base64 characters
|
||||
*
|
||||
* @param string $data Data to decode
|
||||
* @return string
|
||||
*/
|
||||
public static function base64_decode( $data ) {
|
||||
return base64_decode( $data );
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate base64 data
|
||||
*
|
||||
* @param string $data Data to validate
|
||||
* @return boolean
|
||||
*/
|
||||
public static function base64_validate( $data ) {
|
||||
return base64_encode( base64_decode( $data ) ) === $data;
|
||||
}
|
||||
}
|
||||
2054
wp-content/plugins/all-in-one-wp-migration/lib/vendor/servmask/database/class-ai1wm-database.php
vendored
Normal file
2054
wp-content/plugins/all-in-one-wp-migration/lib/vendor/servmask/database/class-ai1wm-database.php
vendored
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,77 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2014-2020 ServMask Inc.
|
||||
*
|
||||
* 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/>.
|
||||
*
|
||||
* ███████╗███████╗██████╗ ██╗ ██╗███╗ ███╗ █████╗ ███████╗██╗ ██╗
|
||||
* ██╔════╝██╔════╝██╔══██╗██║ ██║████╗ ████║██╔══██╗██╔════╝██║ ██╔╝
|
||||
* ███████╗█████╗ ██████╔╝██║ ██║██╔████╔██║███████║███████╗█████╔╝
|
||||
* ╚════██║██╔══╝ ██╔══██╗╚██╗ ██╔╝██║╚██╔╝██║██╔══██║╚════██║██╔═██╗
|
||||
* ███████║███████╗██║ ██║ ╚████╔╝ ██║ ╚═╝ ██║██║ ██║███████║██║ ██╗
|
||||
* ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
die( 'Kangaroos cannot jump here' );
|
||||
}
|
||||
|
||||
class Ai1wm_Directory {
|
||||
|
||||
/**
|
||||
* Create directory (recursively)
|
||||
*
|
||||
* @param string $path Path to the directory
|
||||
* @return boolean
|
||||
*/
|
||||
public static function create( $path ) {
|
||||
if ( @is_dir( $path ) ) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return @mkdir( $path, 0777, true );
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete directory (recursively)
|
||||
*
|
||||
* @param string $path Path to the directory
|
||||
* @return boolean
|
||||
*/
|
||||
public static function delete( $path ) {
|
||||
if ( @is_dir( $path ) ) {
|
||||
try {
|
||||
// Iterate over directory
|
||||
$iterator = new Ai1wm_Recursive_Directory_Iterator( $path );
|
||||
|
||||
// Recursively iterate over directory
|
||||
$iterator = new Ai1wm_Recursive_Iterator_Iterator( $iterator, RecursiveIteratorIterator::CHILD_FIRST, RecursiveIteratorIterator::CATCH_GET_CHILD );
|
||||
|
||||
// Remove files and directories
|
||||
foreach ( $iterator as $item ) {
|
||||
if ( $item->isDir() ) {
|
||||
@rmdir( $item->getPathname() );
|
||||
} else {
|
||||
@unlink( $item->getPathname() );
|
||||
}
|
||||
}
|
||||
} catch ( Exception $e ) {
|
||||
}
|
||||
|
||||
return @rmdir( $path );
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2014-2020 ServMask Inc.
|
||||
*
|
||||
* 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/>.
|
||||
*
|
||||
* ███████╗███████╗██████╗ ██╗ ██╗███╗ ███╗ █████╗ ███████╗██╗ ██╗
|
||||
* ██╔════╝██╔════╝██╔══██╗██║ ██║████╗ ████║██╔══██╗██╔════╝██║ ██╔╝
|
||||
* ███████╗█████╗ ██████╔╝██║ ██║██╔████╔██║███████║███████╗█████╔╝
|
||||
* ╚════██║██╔══╝ ██╔══██╗╚██╗ ██╔╝██║╚██╔╝██║██╔══██║╚════██║██╔═██╗
|
||||
* ███████║███████╗██║ ██║ ╚████╔╝ ██║ ╚═╝ ██║██║ ██║███████║██║ ██╗
|
||||
* ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
die( 'Kangaroos cannot jump here' );
|
||||
}
|
||||
|
||||
class Ai1wm_File_Htaccess {
|
||||
|
||||
/**
|
||||
* Create .htaccess file (ServMask)
|
||||
*
|
||||
* @param string $path Path to file
|
||||
* @return boolean
|
||||
*/
|
||||
public static function create( $path ) {
|
||||
return Ai1wm_File::create(
|
||||
$path,
|
||||
implode(
|
||||
PHP_EOL,
|
||||
array(
|
||||
'<IfModule mod_mime.c>',
|
||||
'AddType application/octet-stream .wpress',
|
||||
'</IfModule>',
|
||||
'<IfModule mod_dir.c>',
|
||||
'DirectoryIndex index.php',
|
||||
'</IfModule>',
|
||||
'<IfModule mod_autoindex.c>',
|
||||
'Options -Indexes',
|
||||
'</IfModule>',
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create .htaccess file (LiteSpeed)
|
||||
*
|
||||
* @param string $path Path to file
|
||||
* @return boolean
|
||||
*/
|
||||
public static function litespeed( $path ) {
|
||||
return Ai1wm_File::create_with_markers(
|
||||
$path,
|
||||
'LiteSpeed',
|
||||
array(
|
||||
'<IfModule Litespeed>',
|
||||
'SetEnv noabort 1',
|
||||
'</IfModule>',
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2014-2020 ServMask Inc.
|
||||
*
|
||||
* 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/>.
|
||||
*
|
||||
* ███████╗███████╗██████╗ ██╗ ██╗███╗ ███╗ █████╗ ███████╗██╗ ██╗
|
||||
* ██╔════╝██╔════╝██╔══██╗██║ ██║████╗ ████║██╔══██╗██╔════╝██║ ██╔╝
|
||||
* ███████╗█████╗ ██████╔╝██║ ██║██╔████╔██║███████║███████╗█████╔╝
|
||||
* ╚════██║██╔══╝ ██╔══██╗╚██╗ ██╔╝██║╚██╔╝██║██╔══██║╚════██║██╔═██╗
|
||||
* ███████║███████╗██║ ██║ ╚████╔╝ ██║ ╚═╝ ██║██║ ██║███████║██║ ██╗
|
||||
* ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
die( 'Kangaroos cannot jump here' );
|
||||
}
|
||||
|
||||
class Ai1wm_File_Index {
|
||||
|
||||
/**
|
||||
* Create index file
|
||||
*
|
||||
* @param string $path Path to file
|
||||
* @return boolean
|
||||
*/
|
||||
public static function create( $path ) {
|
||||
return Ai1wm_File::create( $path, 'Kangaroos cannot jump here' );
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2014-2020 ServMask Inc.
|
||||
*
|
||||
* 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/>.
|
||||
*
|
||||
* ███████╗███████╗██████╗ ██╗ ██╗███╗ ███╗ █████╗ ███████╗██╗ ██╗
|
||||
* ██╔════╝██╔════╝██╔══██╗██║ ██║████╗ ████║██╔══██╗██╔════╝██║ ██╔╝
|
||||
* ███████╗█████╗ ██████╔╝██║ ██║██╔████╔██║███████║███████╗█████╔╝
|
||||
* ╚════██║██╔══╝ ██╔══██╗╚██╗ ██╔╝██║╚██╔╝██║██╔══██║╚════██║██╔═██╗
|
||||
* ███████║███████╗██║ ██║ ╚████╔╝ ██║ ╚═╝ ██║██║ ██║███████║██║ ██╗
|
||||
* ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
die( 'Kangaroos cannot jump here' );
|
||||
}
|
||||
|
||||
class Ai1wm_File_Webconfig {
|
||||
|
||||
/**
|
||||
* Create web.config file
|
||||
*
|
||||
* @param string $path Path to file
|
||||
* @return boolean
|
||||
*/
|
||||
public static function create( $path ) {
|
||||
return Ai1wm_File::create(
|
||||
$path,
|
||||
implode(
|
||||
PHP_EOL,
|
||||
array(
|
||||
'<configuration>',
|
||||
'<system.webServer>',
|
||||
'<staticContent>',
|
||||
'<mimeMap fileExtension=".wpress" mimeType="application/octet-stream" />',
|
||||
'</staticContent>',
|
||||
'<defaultDocument>',
|
||||
'<files>',
|
||||
'<add value="index.php" />',
|
||||
'</files>',
|
||||
'</defaultDocument>',
|
||||
'<directoryBrowse enabled="false" />',
|
||||
'</system.webServer>',
|
||||
'</configuration>',
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
96
wp-content/plugins/all-in-one-wp-migration/lib/vendor/servmask/filesystem/class-ai1wm-file.php
vendored
Normal file
96
wp-content/plugins/all-in-one-wp-migration/lib/vendor/servmask/filesystem/class-ai1wm-file.php
vendored
Normal file
@@ -0,0 +1,96 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2014-2020 ServMask Inc.
|
||||
*
|
||||
* 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/>.
|
||||
*
|
||||
* ███████╗███████╗██████╗ ██╗ ██╗███╗ ███╗ █████╗ ███████╗██╗ ██╗
|
||||
* ██╔════╝██╔════╝██╔══██╗██║ ██║████╗ ████║██╔══██╗██╔════╝██║ ██╔╝
|
||||
* ███████╗█████╗ ██████╔╝██║ ██║██╔████╔██║███████║███████╗█████╔╝
|
||||
* ╚════██║██╔══╝ ██╔══██╗╚██╗ ██╔╝██║╚██╔╝██║██╔══██║╚════██║██╔═██╗
|
||||
* ███████║███████╗██║ ██║ ╚████╔╝ ██║ ╚═╝ ██║██║ ██║███████║██║ ██╗
|
||||
* ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
die( 'Kangaroos cannot jump here' );
|
||||
}
|
||||
|
||||
class Ai1wm_File {
|
||||
|
||||
/**
|
||||
* Create a file with content
|
||||
*
|
||||
* @param string $path Path to the file
|
||||
* @param string $content Content of the file
|
||||
* @return boolean
|
||||
*/
|
||||
public static function create( $path, $content ) {
|
||||
if ( ! @file_exists( $path ) ) {
|
||||
if ( ! @is_writable( dirname( $path ) ) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( ! @touch( $path ) ) {
|
||||
return false;
|
||||
}
|
||||
} elseif ( ! @is_writable( $path ) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// No changes were added
|
||||
if ( function_exists( 'md5_file' ) ) {
|
||||
if ( @md5_file( $path ) === md5( $content ) ) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
$is_written = false;
|
||||
if ( ( $handle = @fopen( $path, 'w' ) ) !== false ) {
|
||||
if ( @fwrite( $handle, $content ) !== false ) {
|
||||
$is_written = true;
|
||||
}
|
||||
|
||||
@fclose( $handle );
|
||||
}
|
||||
|
||||
return $is_written;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a file with marker and content
|
||||
*
|
||||
* @param string $path Path to the file
|
||||
* @param string $marker Name of the marker
|
||||
* @param string $content Content of the file
|
||||
* @return boolean
|
||||
*/
|
||||
public static function create_with_markers( $path, $marker, $content ) {
|
||||
return @insert_with_markers( $path, $marker, $content );
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete a file by path
|
||||
*
|
||||
* @param string $path Path to the file
|
||||
* @return boolean
|
||||
*/
|
||||
public static function delete( $path ) {
|
||||
if ( ! @file_exists( $path ) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return @unlink( $path );
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2014-2020 ServMask Inc.
|
||||
*
|
||||
* 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/>.
|
||||
*
|
||||
* ███████╗███████╗██████╗ ██╗ ██╗███╗ ███╗ █████╗ ███████╗██╗ ██╗
|
||||
* ██╔════╝██╔════╝██╔══██╗██║ ██║████╗ ████║██╔══██╗██╔════╝██║ ██╔╝
|
||||
* ███████╗█████╗ ██████╔╝██║ ██║██╔████╔██║███████║███████╗█████╔╝
|
||||
* ╚════██║██╔══╝ ██╔══██╗╚██╗ ██╔╝██║╚██╔╝██║██╔══██║╚════██║██╔═██╗
|
||||
* ███████║███████╗██║ ██║ ╚████╔╝ ██║ ╚═╝ ██║██║ ██║███████║██║ ██╗
|
||||
* ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
die( 'Kangaroos cannot jump here' );
|
||||
}
|
||||
|
||||
class Ai1wm_Recursive_Exclude_Filter extends RecursiveFilterIterator {
|
||||
|
||||
protected $exclude = array();
|
||||
|
||||
public function __construct( RecursiveIterator $iterator, $exclude = array() ) {
|
||||
parent::__construct( $iterator );
|
||||
if ( is_array( $exclude ) ) {
|
||||
foreach ( $exclude as $path ) {
|
||||
$this->exclude[] = ai1wm_replace_forward_slash_with_directory_separator( $path );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function accept() {
|
||||
if ( in_array( ai1wm_replace_forward_slash_with_directory_separator( $this->getInnerIterator()->getSubPathname() ), $this->exclude ) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( in_array( ai1wm_replace_forward_slash_with_directory_separator( $this->getInnerIterator()->getPathname() ), $this->exclude ) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( in_array( ai1wm_replace_forward_slash_with_directory_separator( $this->getInnerIterator()->getPath() ), $this->exclude ) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( strpos( $this->getInnerIterator()->getSubPathname(), "\n" ) !== false ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( strpos( $this->getInnerIterator()->getSubPathname(), "\r" ) !== false ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public function getChildren() {
|
||||
return new self( $this->getInnerIterator()->getChildren(), $this->exclude );
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2014-2020 ServMask Inc.
|
||||
*
|
||||
* 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/>.
|
||||
*
|
||||
* ███████╗███████╗██████╗ ██╗ ██╗███╗ ███╗ █████╗ ███████╗██╗ ██╗
|
||||
* ██╔════╝██╔════╝██╔══██╗██║ ██║████╗ ████║██╔══██╗██╔════╝██║ ██╔╝
|
||||
* ███████╗█████╗ ██████╔╝██║ ██║██╔████╔██║███████║███████╗█████╔╝
|
||||
* ╚════██║██╔══╝ ██╔══██╗╚██╗ ██╔╝██║╚██╔╝██║██╔══██║╚════██║██╔═██╗
|
||||
* ███████║███████╗██║ ██║ ╚████╔╝ ██║ ╚═╝ ██║██║ ██║███████║██║ ██╗
|
||||
* ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
die( 'Kangaroos cannot jump here' );
|
||||
}
|
||||
|
||||
class Ai1wm_Recursive_Extension_Filter extends RecursiveFilterIterator {
|
||||
|
||||
protected $include = array();
|
||||
|
||||
public function __construct( RecursiveIterator $iterator, $include = array() ) {
|
||||
parent::__construct( $iterator );
|
||||
if ( is_array( $include ) ) {
|
||||
$this->include = $include;
|
||||
}
|
||||
}
|
||||
|
||||
public function accept() {
|
||||
if ( $this->getInnerIterator()->isFile() ) {
|
||||
if ( ! in_array( pathinfo( $this->getInnerIterator()->getFilename(), PATHINFO_EXTENSION ), $this->include ) ) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public function getChildren() {
|
||||
return new self( $this->getInnerIterator()->getChildren(), $this->include );
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2014-2020 ServMask Inc.
|
||||
*
|
||||
* 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/>.
|
||||
*
|
||||
* ███████╗███████╗██████╗ ██╗ ██╗███╗ ███╗ █████╗ ███████╗██╗ ██╗
|
||||
* ██╔════╝██╔════╝██╔══██╗██║ ██║████╗ ████║██╔══██╗██╔════╝██║ ██╔╝
|
||||
* ███████╗█████╗ ██████╔╝██║ ██║██╔████╔██║███████║███████╗█████╔╝
|
||||
* ╚════██║██╔══╝ ██╔══██╗╚██╗ ██╔╝██║╚██╔╝██║██╔══██║╚════██║██╔═██╗
|
||||
* ███████║███████╗██║ ██║ ╚████╔╝ ██║ ╚═╝ ██║██║ ██║███████║██║ ██╗
|
||||
* ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
die( 'Kangaroos cannot jump here' );
|
||||
}
|
||||
|
||||
class Ai1wm_Recursive_Directory_Iterator extends RecursiveDirectoryIterator {
|
||||
|
||||
public function __construct( $path ) {
|
||||
parent::__construct( $path );
|
||||
|
||||
// Skip current and parent directory
|
||||
$this->skipdots();
|
||||
}
|
||||
|
||||
public function rewind() {
|
||||
parent::rewind();
|
||||
|
||||
// Skip current and parent directory
|
||||
$this->skipdots();
|
||||
}
|
||||
|
||||
public function next() {
|
||||
parent::next();
|
||||
|
||||
// Skip current and parent directory
|
||||
$this->skipdots();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether current entry is a directory and not '.' or '..'
|
||||
*
|
||||
* Explicitly set allow links flag, because RecursiveDirectoryIterator::FOLLOW_SYMLINKS
|
||||
* is not supported by <= PHP 5.3.0
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function hasChildren( $allow_links = true ) {
|
||||
return parent::hasChildren( $allow_links );
|
||||
}
|
||||
|
||||
protected function skipdots() {
|
||||
while ( $this->isDot() ) {
|
||||
parent::next();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2014-2020 ServMask Inc.
|
||||
*
|
||||
* 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/>.
|
||||
*
|
||||
* ███████╗███████╗██████╗ ██╗ ██╗███╗ ███╗ █████╗ ███████╗██╗ ██╗
|
||||
* ██╔════╝██╔════╝██╔══██╗██║ ██║████╗ ████║██╔══██╗██╔════╝██║ ██╔╝
|
||||
* ███████╗█████╗ ██████╔╝██║ ██║██╔████╔██║███████║███████╗█████╔╝
|
||||
* ╚════██║██╔══╝ ██╔══██╗╚██╗ ██╔╝██║╚██╔╝██║██╔══██║╚════██║██╔═██╗
|
||||
* ███████║███████╗██║ ██║ ╚████╔╝ ██║ ╚═╝ ██║██║ ██║███████║██║ ██╗
|
||||
* ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
die( 'Kangaroos cannot jump here' );
|
||||
}
|
||||
|
||||
class Ai1wm_Recursive_Iterator_Iterator extends RecursiveIteratorIterator {
|
||||
|
||||
}
|
||||
1
wp-content/plugins/all-in-one-wp-migration/lib/view/assets/css/backups.min.css
vendored
Normal file
1
wp-content/plugins/all-in-one-wp-migration/lib/view/assets/css/backups.min.css
vendored
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1
wp-content/plugins/all-in-one-wp-migration/lib/view/assets/css/export.min.css
vendored
Normal file
1
wp-content/plugins/all-in-one-wp-migration/lib/view/assets/css/export.min.css
vendored
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1
wp-content/plugins/all-in-one-wp-migration/lib/view/assets/css/import.min.css
vendored
Normal file
1
wp-content/plugins/all-in-one-wp-migration/lib/view/assets/css/import.min.css
vendored
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1
wp-content/plugins/all-in-one-wp-migration/lib/view/assets/css/servmask.min.css
vendored
Normal file
1
wp-content/plugins/all-in-one-wp-migration/lib/view/assets/css/servmask.min.css
vendored
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1
wp-content/plugins/all-in-one-wp-migration/lib/view/assets/css/updater.min.css
vendored
Normal file
1
wp-content/plugins/all-in-one-wp-migration/lib/view/assets/css/updater.min.css
vendored
Normal file
@@ -0,0 +1 @@
|
||||
@charset "UTF-8";.ai1wm-button-group{border:2px solid #27ae60;background-color:transparent;color:#27ae60;border-radius:5px;cursor:pointer;text-transform:uppercase;font-weight:600;transition:background-color .2s ease-out;display:inline-block;text-align:left}.ai1wm-button-group.ai1wm-button-export,.ai1wm-button-group.ai1wm-button-import{box-sizing:content-box}.ai1wm-button-group.ai1wm-button-export.ai1wm-open>.ai1wm-dropdown-menu{height:448px;border-top:1px solid #27ae60}.ai1wm-button-group.ai1wm-button-import.ai1wm-open>.ai1wm-dropdown-menu{height:476px;border-top:1px solid #27ae60}.ai1wm-button-group .ai1wm-button-main{position:relative;padding:6px 50px 6px 25px;box-sizing:content-box}.ai1wm-button-group .ai1wm-dropdown-menu{height:0;overflow:hidden;transition:height .2s cubic-bezier(.19,1,.22,1);border-top:none}.ai1wm-dropdown-menu{list-style:none}.ai1wm-dropdown-menu,.ai1wm-dropdown-menu li{margin:0!important;padding:0}.ai1wm-dropdown-menu li a,.ai1wm-dropdown-menu li a:visited{display:block;padding:5px 26px;text-decoration:none;color:#27ae60;text-align:left;box-sizing:content-box}.ai1wm-dropdown-menu li a:hover,.ai1wm-dropdown-menu li a:visited:hover{text-decoration:none;color:#111}.ai1mw-lines{position:absolute;width:12px;height:10px;top:9px;right:20px}.ai1wm-line{position:absolute;width:100%;height:2px;margin:auto;background:#27ae60;transition:all .2s ease-in-out}.ai1wm-line-first{top:0;left:0}div.ai1wm-open .ai1wm-line-first,div.ai1wm-open .ai1wm-line-third{top:50%}.ai1wm-line-second{top:50%;left:0}.ai1wm-line-third{top:100%;left:0}.ai1wm-button-blue,.ai1wm-button-gray,.ai1wm-button-green,.ai1wm-button-green-small,.ai1wm-button-red{display:inline-block;border:2px solid #95a5a6;background-color:transparent;color:#95a5a6;border-radius:5px;cursor:pointer;padding:5px 25px 5px 26px;text-transform:uppercase;font-weight:600;outline:0;transition:background-color .2s ease-out;text-decoration:none}.ai1wm-button-gray:hover{background-color:#95a5a6;color:#fff}.ai1wm-button-blue,.ai1wm-button-green,.ai1wm-button-green-small,.ai1wm-button-red{border:2px solid #27ae60;color:#27ae60}.ai1wm-button-green:hover{background-color:#27ae60;color:#fff}.ai1wm-button-blue,.ai1wm-button-green-small,.ai1wm-button-red{border:2px solid #6eb649;color:#6eb649}.ai1wm-button-green-small:hover{background-color:#6eb649;color:#fff}.ai1wm-button-blue,.ai1wm-button-red{border:2px solid #00aff0;color:#00aff0}.ai1wm-button-blue:hover{background-color:#00aff0;color:#fff}.ai1wm-button-red{border:2px solid #e74c3c;color:#e74c3c}.ai1wm-button-red:hover{background-color:#e74c3c;color:#fff}.ai1wm-button-blue[disabled=disabled],.ai1wm-button-green-small[disabled=disabled],.ai1wm-button-green[disabled=disabled],.ai1wm-button-red[disabled=disabled]{opacity:.6;cursor:default}.ai1wm-button-blue[disabled=disabled]:hover{color:#00aff0}.ai1wm-button-red[disabled=disabled]:hover{color:#e74c3c}.ai1wm-button-green[disabled=disabled]:hover{color:#27ae60}.ai1wm-button-blue[disabled=disabled]:hover,.ai1wm-button-green-small[disabled=disabled]:hover,.ai1wm-button-green[disabled=disabled]:hover,.ai1wm-button-red[disabled=disabled]:hover{background:0 0}.ai1wm-message-close-button{position:absolute;right:10px;top:6px;text-decoration:none;font-size:10px}input[type=radio].ai1wm-flat-radio-button{display:none}input[type=radio].ai1wm-flat-radio-button+a i,input[type=radio].ai1wm-flat-radio-button+label i{vertical-align:middle;float:left;width:25px;height:25px;border-radius:50%;background:0 0;border:2px solid #ccc;content:" ";cursor:pointer;position:relative;box-sizing:content-box}input[type=radio].ai1wm-flat-radio-button:checked+a i,input[type=radio].ai1wm-flat-radio-button:checked+label i{background-color:#d9d9d9;border-color:#6f6f6f}.ai1wm-icon-update{font-size:13px;padding:0;margin:0;font-weight:400}.ai1wm-icon-update:before{color:#d54e21;content:'\f463';display:inline-block;font:20px/1 'dashicons';speak:none;padding:0;margin:0;vertical-align:top}.ai1wm-modal-dialog{position:fixed;top:0;right:0;bottom:0;left:0;background:rgba(0,0,0,.7);z-index:99999;opacity:0;transition:opacity 400ms ease-in;pointer-events:none}.ai1wm-modal-dialog:target{opacity:1;pointer-events:auto}.ai1wm-modal-dialog .ai1wm-modal-container{position:fixed;top:50%;left:50%;z-index:100002;width:480px;height:auto;padding:6px 16px 10px;-webkit-transform:translate(-240px,-94px);transform:translate(-240px,-94px);border:1px solid #fff;box-shadow:0 2px 6px #292929;border-radius:6px;background:#f6f6f6;box-sizing:border-box}.ai1wm-modal-dialog .ai1wm-modal-container .ai1wm-modal-error{color:red}.ai1wm-modal-dialog .ai1wm-modal-container .ai1wm-modal-buttons{text-align:left}.ai1wm-modal-dialog .ai1wm-modal-container .ai1wm-purchase-id{width:100%;padding:6px}.ai1wm-modal-dialog .ai1wm-modal-container .ai1wm-help-link{font-weight:700}.ai1wm-modal-dialog .ai1wm-modal-container .ai1wm-purchase-discard{margin-left:1em}.ai1wm-error-message,.ai1wm-update-message{padding:0;margin:0;color:red}
|
||||
@@ -0,0 +1 @@
|
||||
@charset "UTF-8";.ai1wm-button-group{border:2px solid #27ae60;background-color:transparent;color:#27ae60;border-radius:5px;cursor:pointer;text-transform:uppercase;font-weight:600;transition:background-color .2s ease-out;display:inline-block;text-align:right}.ai1wm-button-group.ai1wm-button-export,.ai1wm-button-group.ai1wm-button-import{box-sizing:content-box}.ai1wm-button-group.ai1wm-button-export.ai1wm-open>.ai1wm-dropdown-menu{height:448px;border-top:1px solid #27ae60}.ai1wm-button-group.ai1wm-button-import.ai1wm-open>.ai1wm-dropdown-menu{height:476px;border-top:1px solid #27ae60}.ai1wm-button-group .ai1wm-button-main{position:relative;padding:6px 25px 6px 50px;box-sizing:content-box}.ai1wm-button-group .ai1wm-dropdown-menu{height:0;overflow:hidden;transition:height .2s cubic-bezier(.19,1,.22,1);border-top:none}.ai1wm-dropdown-menu{list-style:none}.ai1wm-dropdown-menu,.ai1wm-dropdown-menu li{margin:0!important;padding:0}.ai1wm-dropdown-menu li a,.ai1wm-dropdown-menu li a:visited{display:block;padding:5px 26px;text-decoration:none;color:#27ae60;text-align:right;box-sizing:content-box}.ai1wm-dropdown-menu li a:hover,.ai1wm-dropdown-menu li a:visited:hover{text-decoration:none;color:#111}.ai1mw-lines{position:absolute;width:12px;height:10px;top:9px;left:20px}.ai1wm-line{position:absolute;width:100%;height:2px;margin:auto;background:#27ae60;transition:all .2s ease-in-out}.ai1wm-line-first{top:0;right:0}div.ai1wm-open .ai1wm-line-first,div.ai1wm-open .ai1wm-line-third{top:50%}.ai1wm-line-second{top:50%;right:0}.ai1wm-line-third{top:100%;right:0}.ai1wm-button-blue,.ai1wm-button-gray,.ai1wm-button-green,.ai1wm-button-green-small,.ai1wm-button-red{display:inline-block;border:2px solid #95a5a6;background-color:transparent;color:#95a5a6;border-radius:5px;cursor:pointer;padding:5px 26px 5px 25px;text-transform:uppercase;font-weight:600;outline:0;transition:background-color .2s ease-out;text-decoration:none}.ai1wm-button-gray:hover{background-color:#95a5a6;color:#fff}.ai1wm-button-blue,.ai1wm-button-green,.ai1wm-button-green-small,.ai1wm-button-red{border:2px solid #27ae60;color:#27ae60}.ai1wm-button-green:hover{background-color:#27ae60;color:#fff}.ai1wm-button-blue,.ai1wm-button-green-small,.ai1wm-button-red{border:2px solid #6eb649;color:#6eb649}.ai1wm-button-green-small:hover{background-color:#6eb649;color:#fff}.ai1wm-button-blue,.ai1wm-button-red{border:2px solid #00aff0;color:#00aff0}.ai1wm-button-blue:hover{background-color:#00aff0;color:#fff}.ai1wm-button-red{border:2px solid #e74c3c;color:#e74c3c}.ai1wm-button-red:hover{background-color:#e74c3c;color:#fff}.ai1wm-button-blue[disabled=disabled],.ai1wm-button-green-small[disabled=disabled],.ai1wm-button-green[disabled=disabled],.ai1wm-button-red[disabled=disabled]{opacity:.6;cursor:default}.ai1wm-button-blue[disabled=disabled]:hover{color:#00aff0}.ai1wm-button-red[disabled=disabled]:hover{color:#e74c3c}.ai1wm-button-green[disabled=disabled]:hover{color:#27ae60}.ai1wm-button-blue[disabled=disabled]:hover,.ai1wm-button-green-small[disabled=disabled]:hover,.ai1wm-button-green[disabled=disabled]:hover,.ai1wm-button-red[disabled=disabled]:hover{background:100% 0}.ai1wm-message-close-button{position:absolute;left:10px;top:6px;text-decoration:none;font-size:10px}input[type=radio].ai1wm-flat-radio-button{display:none}input[type=radio].ai1wm-flat-radio-button+a i,input[type=radio].ai1wm-flat-radio-button+label i{vertical-align:middle;float:right;width:25px;height:25px;border-radius:50%;background:100% 0;border:2px solid #ccc;content:" ";cursor:pointer;position:relative;box-sizing:content-box}input[type=radio].ai1wm-flat-radio-button:checked+a i,input[type=radio].ai1wm-flat-radio-button:checked+label i{background-color:#d9d9d9;border-color:#6f6f6f}.ai1wm-icon-update{font-size:13px;padding:0;margin:0;font-weight:400}.ai1wm-icon-update:before{color:#d54e21;content:'\f463';display:inline-block;font:20px/1 'dashicons';speak:none;padding:0;margin:0;vertical-align:top}.ai1wm-modal-dialog{position:fixed;top:0;left:0;bottom:0;right:0;background:rgba(0,0,0,.7);z-index:99999;opacity:0;transition:opacity 400ms ease-in;pointer-events:none}.ai1wm-modal-dialog:target{opacity:1;pointer-events:auto}.ai1wm-modal-dialog .ai1wm-modal-container{position:fixed;top:50%;right:50%;z-index:100002;width:480px;height:auto;padding:6px 16px 10px;-webkit-transform:translate(240px,-94px);transform:translate(240px,-94px);border:1px solid #fff;box-shadow:0 2px 6px #292929;border-radius:6px;background:#f6f6f6;box-sizing:border-box}.ai1wm-modal-dialog .ai1wm-modal-container .ai1wm-modal-error{color:red}.ai1wm-modal-dialog .ai1wm-modal-container .ai1wm-modal-buttons{text-align:right}.ai1wm-modal-dialog .ai1wm-modal-container .ai1wm-purchase-id{width:100%;padding:6px}.ai1wm-modal-dialog .ai1wm-modal-container .ai1wm-help-link{font-weight:700}.ai1wm-modal-dialog .ai1wm-modal-container .ai1wm-purchase-discard{margin-right:1em}.ai1wm-error-message,.ai1wm-update-message{padding:0;margin:0;color:red}
|
||||
Binary file not shown.
@@ -0,0 +1,42 @@
|
||||
<?xml version="1.0" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
|
||||
<svg xmlns="http://www.w3.org/2000/svg">
|
||||
<metadata>Generated by IcoMoon</metadata>
|
||||
<defs>
|
||||
<font id="servmask" horiz-adv-x="512">
|
||||
<font-face units-per-em="512" ascent="480" descent="-32" />
|
||||
<missing-glyph horiz-adv-x="512" />
|
||||
<glyph unicode=" " horiz-adv-x="256" d="" />
|
||||
<glyph unicode="" glyph-name="cloud-upload" d="M446.134 286.755c1.222 5.555 1.866 11.324 1.866 17.245 0 44.183-35.817 80-80 80-7.111 0-14.007-0.934-20.566-2.676-12.399 38.676-48.645 66.676-91.434 66.676-43.674 0-80.527-29.168-92.163-69.085-11.371 3.311-23.396 5.085-35.837 5.085-70.692 0-128-57.308-128-128 0-70.694 57.308-128 128-128h64v-96h128v96h112c44.183 0 80 35.816 80 80 0 39.36-28.427 72.081-65.866 78.755zM288 160v-96h-64v96h-80l112 112 112-112h-80z" />
|
||||
<glyph unicode="" glyph-name="export" d="M384 81.92h-332.8v230.4h66.432c0 0 17.639 22.938 55.552 51.2h-147.584c-14.131 0-25.6-11.469-25.6-25.6v-281.6c0-14.157 11.469-25.6 25.6-25.6h384c14.157 0 25.6 11.443 25.6 25.6v95.897l-51.2-42.112v-28.185zM342.067 259.84v-90.88l169.933 133.146-169.933 127.974v-80.128c-206.387-0.025-206.387-204.032-206.387-204.032 58.419 95.949 94.362 113.92 206.387 113.92z" />
|
||||
<glyph unicode="" glyph-name="publish" d="M460.8 460.8h-409.6c-28.16 0-51.2-23.040-51.2-51.2v-307.2c0-28.16 23.040-50.688 51.2-50.688h101.888v50.176h-102.4v236.032h410.624v-236.032h-102.4v-50.202h101.888c28.185 0 51.2 22.553 51.2 50.688v307.226c0 28.16-23.014 51.2-51.2 51.2zM66.585 375.552c-10.624 0-19.2 8.371-19.2 18.688s8.576 18.688 19.2 18.688c10.599 0 19.2-8.371 19.2-18.688s-8.602-18.688-19.2-18.688zM117.785 375.552c-10.624 0-19.2 8.371-19.2 18.688s8.576 18.688 19.2 18.688c10.598 0 19.2-8.371 19.2-18.688s-8.601-18.688-19.2-18.688zM461.337 378.368h-308.25v31.744h308.224v-31.744zM254.669 277.145l-124.211-123.443h76.8v-153.702h94.822v153.702h76.8l-124.211 123.443z" />
|
||||
<glyph unicode="" glyph-name="history" d="M288 448c123.712 0 224-100.288 224-224s-100.288-224-224-224v48c47.012 0 91.209 18.307 124.451 51.549s51.549 77.439 51.549 124.451c0 47.011-18.307 91.209-51.549 124.451s-77.439 51.549-124.451 51.549c-47.011 0-91.209-18.307-124.451-51.549-25.57-25.569-42.291-57.623-48.653-92.451h93.104l-112-128-112 128h82.285c15.53 108.551 108.869 192 221.715 192zM384 256v-64h-128v160h64v-96z" />
|
||||
<glyph unicode="" glyph-name="arrow-down" d="M512 224c0 141.385-114.615 256-256 256s-256-114.615-256-256 114.615-256 256-256 256 114.615 256 256zM48 224c0 114.875 93.125 208 208 208s208-93.125 208-208-93.125-208-208-208-208 93.125-208 208zM278.627 73.372l128 128.001c12.497 12.496 12.497 32.757 0 45.254s-32.758 12.497-45.255 0l-73.372-73.372v178.745c0 17.673-14.327 32-32 32s-32-14.327-32-32v-178.745l-73.372 73.373c-12.497 12.497-32.759 12.497-45.256 0-6.248-6.249-9.372-14.439-9.372-22.628s3.124-16.379 9.372-22.627l128-128.001c12.497-12.496 32.759-12.496 45.255 0z" />
|
||||
<glyph unicode="" glyph-name="arrow-right" d="M153.625 348.16l-0.025-235.52 204.8 117.76z" />
|
||||
<glyph unicode="" glyph-name="dropbox" d="M18.285 196l96.572 77.428 141.143-87.143-97.714-81.428zM18.285 350.572l140 91.143 97.714-81.429-141.143-86.857zM116.285 84v30.857l42-27.428 97.714 81.143v0.572l0.286-0.286 0.286 0.286v-0.572l98-81.143 42 27.428v-30.857l-140-83.714v-0.286l-0.286 0.286-0.286-0.286v0.286zM256 186.286l141.143 87.143 96.572-77.428-139.714-91.143zM256 360.286l98 81.428 139.714-91.143-96.572-77.143z" />
|
||||
<glyph unicode="" glyph-name="plus2" d="M256 445.44c-118.784 0-215.040-96.307-215.040-215.040 0-118.784 96.281-215.040 215.040-215.040s215.040 96.281 215.040 215.040c0 118.758-96.281 215.040-215.040 215.040zM282.163 204.237v-103.091h-52.327v103.091h-103.117v52.327h103.091v103.117h52.352v-103.091h103.091v-52.352h-103.091z" />
|
||||
<glyph unicode="" glyph-name="paperplane" d="M504.688 477.44c-2.656 1.712-5.68 2.56-8.688 2.56-3.088 0-6.192-0.88-8.88-2.688l-480-320c-4.944-3.28-7.664-9.056-7.024-14.976 0.608-5.904 4.448-11.008 9.968-13.184l125.184-50.096 58.864-103.008c2.816-4.944 8.048-8 13.712-8.064 0.064 0 0.112 0 0.176 0 5.616 0 10.832 2.976 13.712 7.776l33.232 55.408 155.12-62.032c1.904-0.768 3.904-1.136 5.936-1.136 2.72 0 5.408 0.688 7.84 2.064 4.224 2.368 7.12 6.528 7.936 11.312l80 480c1.040 6.288-1.744 12.592-7.088 16.064zM50.176 147.568l370.8 247.216-269.6-288.592c-1.424 0.848-2.688 1.968-4.256 2.592l-96.944 38.784zM163.024 94.944c-0.032 0.064-0.080 0.096-0.112 0.16l303.088 324.4-258.384-402.592-44.592 78.032zM403.472 6.256l-136.656 54.656c-3.248 1.28-6.624 1.712-9.968 1.904l210.432 326.208-63.808-382.768z" />
|
||||
<glyph unicode="" glyph-name="help" d="M256-23.273c-141.382 0-256 114.618-256 256s114.618 256 256 256 256-114.618 256-256-114.618-256-256-256zM256 442.182c-115.689 0-209.454-93.766-209.454-209.455s93.766-209.454 209.454-209.454 209.454 93.766 209.454 209.454-93.766 209.455-209.454 209.455zM279.272 189.487c0-12.753 0-26.577 0-26.577h-46.546c0 0 0 33.675 0 46.546s10.426 23.272 23.273 23.272v0c25.693 0 46.545 20.852 46.545 46.546s-20.853 46.546-46.546 46.546-46.546-20.852-46.546-46.546c0-8.518 2.444-16.407 6.447-23.272h-49.688c-1.955 7.47-3.304 15.197-3.304 23.272 0 51.41 41.681 93.091 93.091 93.091s93.091-41.681 93.091-93.091c0-43.31-29.719-79.406-69.818-89.786zM279.272 93.091h-46.546v46.546h46.546v-46.546z" />
|
||||
<glyph unicode="" glyph-name="gear" d="M486.256 277.12l-49.024 9.824c-2.464 7.088-5.376 13.968-8.592 20.624l27.776 41.664c8.464 12.688 6.784 29.6-4 40.368l-30.784 30.784c-6.192 6.192-14.368 9.376-22.656 9.376-6.128 0-12.32-1.76-17.712-5.376l-41.664-27.76c-6.688 3.232-13.568 6.112-20.656 8.576l-9.824 49.040c-2.976 14.976-16.128 25.728-31.376 25.728h-43.52c-15.248 0-28.384-10.768-31.376-25.728l-9.824-49.040c-7.088-2.464-13.968-5.36-20.624-8.576l-41.648 27.76c-5.424 3.616-11.6 5.376-17.744 5.376-8.272 0-16.448-3.184-22.64-9.376l-30.768-30.784c-10.784-10.784-12.464-27.68-4-40.368l27.76-41.664c-3.232-6.672-6.112-13.552-8.576-20.64l-49.056-9.808c-14.96-2.992-25.728-16.128-25.728-31.376v-43.52c0-15.248 10.768-28.4 25.728-31.376l49.040-9.84c2.464-7.088 5.36-13.968 8.576-20.624l-27.744-41.664c-8.464-12.688-6.784-29.6 4-40.368l30.784-30.784c6.192-6.192 14.368-9.376 22.64-9.376 6.144 0 12.336 1.776 17.728 5.376l41.664 27.776c6.672-3.248 13.552-6.128 20.64-8.592l9.808-49.024c2.992-14.976 16.128-25.744 31.376-25.744h43.52c15.248 0 28.4 10.784 31.376 25.744l9.84 49.024c7.088 2.464 13.968 5.376 20.624 8.592l41.664-27.776c5.408-3.6 11.6-5.376 17.712-5.376 8.288 0 16.464 3.184 22.656 9.376l30.784 30.784c10.784 10.784 12.464 27.68 4 40.368l-27.776 41.664c3.248 6.688 6.128 13.568 8.592 20.656l49.024 9.808c14.96 2.96 25.744 16.128 25.744 31.376v43.52c0 15.248-10.784 28.384-25.744 31.376zM430.944 192.4c-11.12-2.224-20.224-10.16-23.936-20.88-2.064-5.904-4.464-11.632-7.152-17.184-4.976-10.224-4.128-22.288 2.16-31.712l27.776-41.664-30.784-30.784-41.664 27.776c-5.344 3.568-11.536 5.376-17.744 5.376-4.752 0-9.536-1.056-13.936-3.184-5.568-2.688-11.28-5.12-17.216-7.184-10.688-3.712-18.624-12.816-20.848-23.936l-9.84-49.056h-43.52l-9.808 49.056c-2.224 11.12-10.16 20.224-20.864 23.936-5.904 2.064-11.648 4.464-17.2 7.152-4.416 2.16-9.184 3.216-13.952 3.216-6.224 0-12.4-1.808-17.744-5.376l-41.664-27.776-30.784 30.784 27.76 41.664c6.288 9.44 7.104 21.504 2.192 31.68-2.688 5.568-5.104 11.28-7.168 17.216-3.712 10.688-12.832 18.624-23.936 20.848l-49.040 9.84-0.032 43.536 49.056 9.808c11.104 2.224 20.224 10.16 23.936 20.864 2.064 5.904 4.448 11.648 7.152 17.2 4.96 10.208 4.128 22.272-2.176 31.696l-27.744 41.664 30.768 30.784 41.664-27.76c5.344-3.568 11.536-5.376 17.744-5.376 4.752 0 9.52 1.056 13.936 3.184 5.552 2.688 11.28 5.104 17.2 7.168 10.704 3.712 18.64 12.832 20.864 23.936l9.824 49.040 43.52 0.016 9.808-49.056c2.224-11.104 10.16-20.224 20.88-23.936 5.904-2.064 11.632-4.448 17.184-7.152 4.432-2.144 9.184-3.2 13.968-3.2 6.224 0 12.4 1.808 17.744 5.376l41.664 27.76 30.784-30.784-27.776-41.664c-6.288-9.44-7.088-21.488-2.192-31.68 2.688-5.552 5.12-11.28 7.184-17.2 3.712-10.704 12.816-18.64 23.936-20.864l49.024-9.824 0.048-43.52-49.056-9.824zM256 335.984c-61.84 0-112-50.16-112-112 0-61.856 50.16-112 112-112s112 50.16 112 112c0 61.84-50.16 112-112 112zM256 125.968c-54.112 0-98 43.904-98 98 0 54.112 43.888 98 98 98 54.096 0 98-43.888 98-98 0-54.096-43.904-98-98-98zM256 287.984c-35.36 0-64-28.64-64-64 0-35.344 28.64-64 64-64 35.344 0 64 28.656 64 64s-28.656 64-64 64zM256 175.968c-26.496 0-48 21.504-48 48s21.504 48 48 48 48-21.504 48-48c0-26.496-21.504-48-48-48z" />
|
||||
<glyph unicode="" glyph-name="file" d="M446.059 385.941l-60.117 60.118c-18.669 18.668-55.542 33.941-81.942 33.941h-224c-26.4 0-48-21.6-48-48v-416c0-26.4 21.6-48 48-48h352c26.4 0 48 21.6 48 48v288c0 26.4-15.273 63.273-33.941 81.941zM320 412.219c1.098-0.402 2.226-0.84 3.379-1.318 9.030-3.741 15.299-8.088 17.308-10.097l60.118-60.119c2.009-2.009 6.356-8.277 10.097-17.307 0.478-1.153 0.916-2.281 1.318-3.378h-92.22v92.219zM416 32h-320v384h192v-128h128v-256z" />
|
||||
<glyph unicode="" glyph-name="file-content" d="M432 480h-384c-26.4 0-48-21.6-48-48v-416c0-26.4 21.6-48 48-48h384c26.4 0 48 21.6 48 48v416c0 26.4-21.6 48-48 48zM416 32h-352v384h352v-384zM128 256h224v-32h-224zM128 192h224v-32h-224zM128 128h224v-32h-224zM128 320h224v-32h-224z" />
|
||||
<glyph unicode="" glyph-name="chevron-right" horiz-adv-x="329" d="M314 237.714q0-14.857-10.572-26l-186.286-186q-10.572-10.572-25.715-10.572t-25.715 10.572l-21.715 21.428q-10.572 11.143-10.572 26 0 15.143 10.572 25.714l138.857 138.857-138.857 138.572q-10.572 11.143-10.572 26 0 15.143 10.572 25.714l21.715 21.428q10.285 10.857 25.715 10.857t25.715-10.857l186.286-186q10.572-10.571 10.572-25.714z" />
|
||||
<glyph unicode="" glyph-name="folder" d="M0 320h512l-32-320h-448l-32 320zM464 384l16-32h-448l32 64h176l16-32h208z" />
|
||||
<glyph unicode="" glyph-name="file-zip" d="M208 416h48v-32h-48zM160 384h48v-32h-48zM208 352h48v-32h-48zM160 320h48v-32h-48zM208 288h48v-32h-48zM160 256h48v-32h-48zM208 224v-32h-48v-112c0-8.837 7.163-16 16-16h64c8.837 0 16 7.163 16 16v144h-48zM240 96h-64v32h64v-32zM451.716 380.285l-71.432 71.431c-15.556 15.556-46.284 28.284-68.284 28.284h-240c-22 0-40-18-40-40v-432c0-22 18-40 40-40h368c22 0 40 18 40 40v304c0 22-12.728 52.729-28.284 68.285zM429.089 357.657c1.565-1.565 3.125-3.487 4.64-5.657h-81.729v81.728c2.17-1.515 4.092-3.075 5.657-4.64l71.432-71.431zM448 8c0-4.336-3.664-8-8-8h-368c-4.336 0-8 3.664-8 8v432c0 4.336 3.664 8 8 8h240c2.416 0 5.127-0.305 8-0.852v-127.148h127.148c0.547-2.873 0.852-5.583 0.852-8v-304z" />
|
||||
<glyph unicode="" glyph-name="notification" d="M256 432c-55.559 0-107.792-21.636-147.078-60.922s-60.922-91.519-60.922-147.078c0-55.559 21.636-107.792 60.922-147.078s91.519-60.922 147.078-60.922c55.559 0 107.792 21.636 147.078 60.922s60.922 91.519 60.922 147.078c0 55.559-21.636 107.792-60.922 147.078s-91.519 60.922-147.078 60.922zM256 480v0c141.385 0 256-114.615 256-256s-114.615-256-256-256c-141.385 0-256 114.615-256 256s114.615 256 256 256zM224 128h64v-64h-64zM224 384h64v-192h-64z" />
|
||||
<glyph unicode="" glyph-name="close" d="M507.331 68.67c-0.002 0.002-0.004 0.004-0.006 0.005l-155.322 155.325 155.322 155.325c0.002 0.002 0.004 0.003 0.006 0.005 1.672 1.673 2.881 3.627 3.656 5.708 2.123 5.688 0.912 12.341-3.662 16.915l-73.373 73.373c-4.574 4.573-11.225 5.783-16.914 3.66-2.080-0.775-4.035-1.984-5.709-3.655 0-0.002-0.002-0.003-0.004-0.005l-155.324-155.326-155.324 155.325c-0.002 0.002-0.003 0.003-0.005 0.005-1.673 1.671-3.627 2.88-5.707 3.655-5.69 2.124-12.341 0.913-16.915-3.66l-73.374-73.374c-4.574-4.574-5.784-11.226-3.661-16.914 0.776-2.080 1.985-4.036 3.656-5.708 0.002-0.001 0.003-0.003 0.005-0.005l155.325-155.324-155.325-155.326c-0.001-0.002-0.003-0.003-0.004-0.005-1.671-1.673-2.88-3.627-3.657-5.707-2.124-5.688-0.913-12.341 3.661-16.915l73.374-73.373c4.575-4.574 11.226-5.784 16.915-3.661 2.080 0.776 4.035 1.985 5.708 3.656 0.001 0.002 0.003 0.003 0.005 0.005l155.324 155.325 155.324-155.325c0.002-0.001 0.004-0.003 0.006-0.004 1.674-1.672 3.627-2.881 5.707-3.657 5.689-2.123 12.342-0.913 16.914 3.661l73.373 73.374c4.574 4.574 5.785 11.227 3.662 16.915-0.776 2.080-1.985 4.034-3.657 5.707z" />
|
||||
<glyph unicode="" glyph-name="wordpress" d="M259.371 207.648l59.015-157.471c0.389-0.925 0.866-1.775 1.375-2.577-19.956-6.841-41.402-10.6-63.759-10.6-18.847 0-37.036 2.69-54.244 7.619l57.613 163.029zM448 224.003c0-68.985-38.388-129.215-95.47-161.629l58.643 165.136c10.956 26.677 14.602 48.010 14.602 66.975 0 6.886-0.469 13.274-1.294 19.229 14.989-26.631 23.519-57.196 23.519-89.711zM64 224.004c0 27.112 5.972 52.849 16.626 76.103l91.589-244.392c-64.054 30.305-108.215 94.276-108.215 168.289zM95.582 326.716c34.329 50.761 93.342 84.284 160.422 84.284 49.984 0 95.496-18.613 129.654-49.098-0.828 0.049-1.635 0.151-2.488 0.151-18.86 0-32.243-16.001-32.243-33.188 0-15.411 9.131-28.448 18.86-43.858 7.3-12.453 15.827-28.454 15.827-51.571 0-16.001-6.318-34.575-14.608-60.45l-19.156-62.316-69.39 201.009c11.558 0.589 21.974 1.775 21.974 1.775 10.347 1.194 9.129 16.002-1.223 15.411 0 0-31.102-2.376-51.175-2.376-18.867 0-50.567 2.376-50.567 2.376-10.355 0.59-11.57-14.815-1.219-15.411 0 0 9.795-1.183 20.139-1.775l29.911-79.825-42.022-122.728-69.917 202.553c11.571 0.591 21.976 1.775 21.976 1.775 10.337 1.194 9.116 16.002-1.229 15.411 0 0-31.093-2.376-51.17-2.376-3.603 0-7.851 0.086-12.356 0.227zM426 480h-340c-47.3 0-86-38.7-86-86v-340c0-47.3 38.7-86 86-86h340c47.3 0 86 38.7 86 86v340c0 47.3-38.7 86-86 86zM480 224c0-123.712-100.288-224-224-224s-224 100.288-224 224 100.288 224 224 224 224-100.288 224-224z" />
|
||||
<glyph unicode="" glyph-name="edit-pencil" d="M314.88 391.68l102.4-102.4-314.88-314.88h-102.4v102.4l314.88 314.88zM350.72 427.52l58.88 58.88 102.4-102.4-58.88-58.88-102.4 102.4z" />
|
||||
<glyph unicode="" glyph-name="chevron-right2" d="M183.168 350.165c-16.661-16.662-16.661-43.67 0-60.331l76.48-76.502-76.48-76.501c-16.661-16.661-16.661-43.669 0-60.331 8.32-8.341 19.243-12.502 30.166-12.502s21.846 4.16 30.166 12.502l136.853 136.832-136.853 136.832c-16.64 16.661-43.69 16.661-60.331 0z" />
|
||||
<glyph unicode="" glyph-name="chevron-left2" d="M307.498 350.165c-16.64 16.661-43.69 16.661-60.331 0l-136.853-136.832 136.853-136.832c8.32-8.341 19.242-12.502 30.165-12.502s21.846 4.16 30.166 12.502c16.661 16.661 16.661 43.669 0 60.331l-76.48 76.502 76.48 76.501c16.661 16.662 16.661 43.67 0 60.331z" />
|
||||
<glyph unicode="" glyph-name="folder-secondary" d="M224 416l64-64h224v-352h-512v416z" />
|
||||
<glyph unicode="" glyph-name="folder-secondary-open" d="M416 0l96 256h-416l-96-256zM64 288l-64-288v416h144l64-64h208v-64z" />
|
||||
<glyph unicode="" glyph-name="database" d="M256 480c-141.385 0-256-35.817-256-80v-64c0-44.183 114.615-80 256-80s256 35.817 256 80v64c0 44.183-114.615 80-256 80zM256 208c-141.385 0-256 35.817-256 80v-96c0-44.183 114.615-80 256-80s256 35.817 256 80v96c0-44.183-114.615-80-256-80zM256 64c-141.385 0-256 35.817-256 80v-96c0-44.183 114.615-80 256-80s256 35.817 256 80v96c0-44.183-114.615-80-256-80z" />
|
||||
<glyph unicode="" glyph-name="upload2" d="M0 32h512v-32h-512zM512 96v-32h-512v32l64 128h128v-64h128v64h128zM112 320l144 144 144-144h-112v-128h-64v128z" />
|
||||
<glyph unicode="" glyph-name="checkmark" d="M432 416l-240-240-112 112-80-80 192-192 320 320z" />
|
||||
<glyph unicode="" glyph-name="checkmark2" d="M198.717 21.152l-198.934 195.8 98.689 97.135 100.245-98.666 214.81 211.426 98.689-97.135-313.499-308.56zM53.956 216.952l144.762-142.481 259.328 255.241-44.518 43.816-214.81-211.426-100.245 98.667-44.517-43.817z" />
|
||||
<glyph unicode="" glyph-name="enter" d="M192 224h-160v64h160v64l96-96-96-96zM512 480v-416l-192-96v96h-192v128h32v-96h160v288l128 64h-288v-128h-32v160z" />
|
||||
<glyph unicode="" glyph-name="exit" d="M384 160v64h-160v64h160v64l96-96zM352 192v-128h-160v-96l-192 96v416h352v-160h-32v128h-256l128-64v-288h128v96z" />
|
||||
<glyph unicode="" glyph-name="amazon" d="M462.8 37.4c-56.1-41.4-137.3-63.4-207.3-63.4-98.1 0-186.4 36.2-253.2 96.6-5.2 4.7-0.6 11.2 5.7 7.5 72.1-42 161.3-67.2 253.4-67.2 62.1 0 130.4 12.9 193.3 39.6 9.4 4 17.4-6.3 8.1-13.1zM486.1 64c-7.2 9.2-47.4 4.4-65.5 2.2-5.5-0.6-6.3 4.1-1.4 7.6 32.1 22.5 84.7 16 90.8 8.5 6.2-7.6-1.6-60.3-31.7-85.5-4.6-3.9-9-1.8-7 3.3 6.9 16.9 22 54.7 14.8 63.9zM353.7 101.2l0.1-0.1c12.4 10.9 34.7 30.4 47.3 40.9 5 4 4.1 10.7 0.2 16.3-11.3 15.6-23.3 28.3-23.3 57.1v96c0 40.7 2.8 78-27.1 106-23.6 22.6-62.8 30.6-92.8 30.6-58.6 0-124-21.9-137.7-94.3-1.5-7.7 4.2-11.8 9.2-12.9l59.7-6.5c5.6 0.3 9.6 5.8 10.7 11.4 5.1 24.9 26 37 49.5 37 12.7 0 27.1-4.6 34.6-16 8.6-12.7 7.5-30 7.5-44.7v-8c-35.7-4-82.4-6.6-115.8-21.3-38.6-16.7-65.7-50.7-65.7-100.7 0-64 40.3-96 92.2-96 43.8 0 67.7 10.3 101.5 44.9 11.2-16.2 14.8-24.1 35.3-41.1 4.7-2.5 10.5-2.3 14.6 1.4zM291.6 251.4c0-24 0.6-44-11.5-65.3-9.8-17.4-25.3-28-42.6-28-23.6 0-37.4 18-37.4 44.6 0 52.5 47.1 62 91.6 62v-13.3z" />
|
||||
<glyph unicode="" glyph-name="onedrive" d="M175.434 65.806c-30.137 7.53-46.928 31.485-46.981 67.032-0.016 11.363 0.806 16.81 3.643 24.118 6.954 17.917 25.364 31.436 49.588 36.411 12.055 2.475 15.768 5.133 15.768 11.286 0 1.931 1.436 7.68 3.189 12.776 7.966 23.153 22.715 42.455 38.474 50.351 16.495 8.263 24.821 10.127 44.774 10.020 28.337-0.152 42.476-6.299 62.248-27.064l10.875-11.421 9.742 3.371c47.15 16.318 94.153-11.458 97.944-57.878l1.036-12.699 9.285-3.325c26.516-9.502 38.98-29.452 36.721-58.778-1.479-19.179-10.445-34.49-24.65-42.092l-6.678-3.573-148.411-0.285c-114.047-0.22-150.3 0.184-156.567 1.75v0zM51.609 87.017c-18.088 4.543-37.253 21.427-46.24 40.735-5.098 10.953-5.369 12.564-5.369 31.94 0 18.432 0.435 21.389 4.494 30.54 8.555 19.291 24.947 33.23 45.515 38.704 4.342 1.156 8.421 3 9.064 4.098 0.645 1.099 1.361 7.082 1.591 13.296 1.433 38.598 25.395 72.607 58.854 83.528 18.077 5.9 41.786 6.449 61.448-1.863 6.235-2.637 5.534-3.202 18.719 15.070 7.797 10.806 22.554 22.245 35.45 29.090 13.919 7.388 28.396 10.792 45.706 10.747 48.384-0.126 90.083-32.11 105.502-80.924 4.927-15.596 4.681-19.963-1.13-20.092-2.536-0.056-9.802-1.532-16.146-3.279l-11.536-3.179-10.526 11.125c-29.681 31.367-78.119 38.147-119.296 16.698-16.45-8.569-29.67-20.873-39.655-36.905-7.118-11.429-16.195-32.752-16.195-38.047 0-3.755-2.877-5.632-15.166-9.891-38.047-13.188-60.254-43.641-60.238-82.609 0.005-14.184 3.461-31.537 8.26-41.478 1.809-3.747 2.817-7.311 2.242-7.918-1.473-1.553-48.804-1.030-55.348 0.614v0z" />
|
||||
</font></defs></svg>
|
||||
|
After Width: | Height: | Size: 18 KiB |
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
After Width: | Height: | Size: 2.5 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 5.3 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 876 B |
Binary file not shown.
|
After Width: | Height: | Size: 1.4 KiB |
@@ -0,0 +1,28 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg version="1.1" id="Group_1_1_" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
viewBox="-256 352 100 100" style="enable-background:new -256 352 100 100;" xml:space="preserve">
|
||||
<style type="text/css">
|
||||
.st0{fill:#92959A;}
|
||||
.st1{fill:#069FE3;}
|
||||
</style>
|
||||
<g id="Ellipse_1_copy_2_xA0_Image_1_">
|
||||
<path class="st0" d="M-204.7,363.4v9.8c16.2,0.7,29.2,14.1,29.2,30.5c0,16.8-13.6,30.6-30.4,30.6c-16.9,0-30.6-13.6-30.6-30.5
|
||||
c0-1.1,0.1-2.1,0.2-3.2h-9.8c-0.1,1.1-0.2,2.1-0.2,3.2c0,22.2,18.1,40.4,40.2,40.4c22.2,0,40.2-18.1,40.2-40.4
|
||||
C-165.7,381.9-183.1,364-204.7,363.4z"/>
|
||||
</g>
|
||||
<g id="Rectangle_2_copy">
|
||||
<g>
|
||||
<polygon class="st0" points="-216.5,367.1 -204.3,379.3 -204.3,354.8 "/>
|
||||
</g>
|
||||
</g>
|
||||
<g id="Layer_4">
|
||||
<path class="st1" d="M-206.5,418.5c-7.2-0.2-13.1-6-13.1-13.3c0-7.4,6-13.4,13.3-13.4c6.1,0,11.4,4.2,12.8,10h10.3
|
||||
c-1.8-11-11.3-19.4-22.7-19.4c-12.7,0-23,10.4-23,23c0,12.5,10,22.7,22.4,23C-206.5,428.4-206.5,418.5-206.5,418.5z"/>
|
||||
</g>
|
||||
<g id="Rectangle_2_copy_2">
|
||||
<g>
|
||||
<polygon class="st1" points="-201.2,400.6 -189.3,413.6 -177.6,400.8 "/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.2 KiB |
1817
wp-content/plugins/all-in-one-wp-migration/lib/view/assets/javascript/backups.min.js
vendored
Normal file
1817
wp-content/plugins/all-in-one-wp-migration/lib/view/assets/javascript/backups.min.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
838
wp-content/plugins/all-in-one-wp-migration/lib/view/assets/javascript/export.min.js
vendored
Normal file
838
wp-content/plugins/all-in-one-wp-migration/lib/view/assets/javascript/export.min.js
vendored
Normal file
@@ -0,0 +1,838 @@
|
||||
/******/ (function() { // webpackBootstrap
|
||||
/******/ var __webpack_modules__ = ({
|
||||
|
||||
/***/ 12:
|
||||
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
||||
|
||||
/**
|
||||
* Copyright (C) 2014-2020 ServMask Inc.
|
||||
*
|
||||
* 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/>.
|
||||
*
|
||||
* ███████╗███████╗██████╗ ██╗ ██╗███╗ ███╗ █████╗ ███████╗██╗ ██╗
|
||||
* ██╔════╝██╔════╝██╔══██╗██║ ██║████╗ ████║██╔══██╗██╔════╝██║ ██╔╝
|
||||
* ███████╗█████╗ ██████╔╝██║ ██║██╔████╔██║███████║███████╗█████╔╝
|
||||
* ╚════██║██╔══╝ ██╔══██╗╚██╗ ██╔╝██║╚██╔╝██║██╔══██║╚════██║██╔═██╗
|
||||
* ███████║███████╗██║ ██║ ╚████╔╝ ██║ ╚═╝ ██║██║ ██║███████║██║ ██╗
|
||||
* ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
|
||||
*/
|
||||
var Modal = __webpack_require__(326),
|
||||
$ = jQuery;
|
||||
|
||||
var Export = function Export() {
|
||||
var self = this; // Set params
|
||||
|
||||
this.params = []; // Set modal
|
||||
|
||||
this.modal = new Modal(); // Set stop listener
|
||||
|
||||
this.modal.onStop = function (options) {
|
||||
self.onStop(options);
|
||||
};
|
||||
};
|
||||
|
||||
Export.prototype.setParams = function (params) {
|
||||
this.params = Ai1wm.Util.list(params);
|
||||
};
|
||||
|
||||
Export.prototype.start = function (options, retries) {
|
||||
var self = this;
|
||||
retries = retries || 0; // Reset stop flag
|
||||
|
||||
if (retries === 0) {
|
||||
this.stopExport(false);
|
||||
} // Stop running export
|
||||
|
||||
|
||||
if (this.isExportStopped()) {
|
||||
return;
|
||||
} // Initializing beforeunload event
|
||||
|
||||
|
||||
$(window).bind('beforeunload', function () {
|
||||
return ai1wm_locale.stop_exporting_your_website;
|
||||
}); // Set initial status
|
||||
|
||||
this.setStatus({
|
||||
type: 'info',
|
||||
message: ai1wm_locale.preparing_to_export
|
||||
}); // Set params
|
||||
|
||||
var params = this.params.concat({
|
||||
name: 'secret_key',
|
||||
value: ai1wm_export.secret_key
|
||||
}); // Set additional params
|
||||
|
||||
if (options) {
|
||||
params = params.concat(Ai1wm.Util.list(options));
|
||||
} // Export
|
||||
|
||||
|
||||
$.ajax({
|
||||
url: ai1wm_export.ajax.url,
|
||||
type: 'POST',
|
||||
dataType: 'json',
|
||||
data: params,
|
||||
dataFilter: function dataFilter(data) {
|
||||
return Ai1wm.Util.json(data);
|
||||
}
|
||||
}).done(function () {
|
||||
self.getStatus();
|
||||
}).done(function (result) {
|
||||
if (result) {
|
||||
self.run(result);
|
||||
}
|
||||
}).fail(function (xhr) {
|
||||
var timeout = retries * 1000;
|
||||
|
||||
try {
|
||||
var json = Ai1wm.Util.json(xhr.responseText);
|
||||
|
||||
if (json) {
|
||||
var result = JSON.parse(json);
|
||||
var error = result.errors.pop();
|
||||
|
||||
if (error.message) {
|
||||
self.stopExport(true);
|
||||
self.setStatus({
|
||||
type: 'error',
|
||||
title: ai1wm_locale.unable_to_export,
|
||||
message: error.message
|
||||
});
|
||||
return;
|
||||
}
|
||||
}
|
||||
} catch (e) {}
|
||||
|
||||
if (retries >= 5) {
|
||||
self.stopExport(true);
|
||||
self.setStatus({
|
||||
type: 'error',
|
||||
title: ai1wm_locale.unable_to_export,
|
||||
message: ai1wm_locale.unable_to_start_the_export
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
retries++;
|
||||
setTimeout(self.start.bind(self, options, retries), timeout);
|
||||
});
|
||||
};
|
||||
|
||||
Export.prototype.run = function (params, retries) {
|
||||
var self = this;
|
||||
retries = retries || 0; // Stop running export
|
||||
|
||||
if (this.isExportStopped()) {
|
||||
return;
|
||||
} // Export
|
||||
|
||||
|
||||
$.ajax({
|
||||
url: ai1wm_export.ajax.url,
|
||||
type: 'POST',
|
||||
dataType: 'json',
|
||||
data: params,
|
||||
dataFilter: function dataFilter(data) {
|
||||
return Ai1wm.Util.json(data);
|
||||
}
|
||||
}).done(function (result) {
|
||||
if (result) {
|
||||
self.run(result);
|
||||
}
|
||||
}).fail(function (xhr) {
|
||||
var timeout = retries * 1000;
|
||||
|
||||
try {
|
||||
var json = Ai1wm.Util.json(xhr.responseText);
|
||||
|
||||
if (json) {
|
||||
var result = JSON.parse(json);
|
||||
var error = result.errors.pop();
|
||||
|
||||
if (error.message) {
|
||||
self.stopExport(true);
|
||||
self.setStatus({
|
||||
type: 'error',
|
||||
title: ai1wm_locale.unable_to_export,
|
||||
message: error.message
|
||||
});
|
||||
return;
|
||||
}
|
||||
}
|
||||
} catch (e) {}
|
||||
|
||||
if (retries >= 5) {
|
||||
self.stopExport(true);
|
||||
self.setStatus({
|
||||
type: 'error',
|
||||
title: ai1wm_locale.unable_to_export,
|
||||
message: ai1wm_locale.unable_to_run_the_export
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
retries++;
|
||||
setTimeout(self.run.bind(self, params, retries), timeout);
|
||||
});
|
||||
};
|
||||
|
||||
Export.prototype.clean = function (options, retries) {
|
||||
var self = this;
|
||||
retries = retries || 0; // Reset stop flag
|
||||
|
||||
if (retries === 0) {
|
||||
this.stopExport(true);
|
||||
} // Set initial status
|
||||
|
||||
|
||||
this.setStatus({
|
||||
type: 'info',
|
||||
message: ai1wm_locale.please_wait_stopping_the_export
|
||||
}); // Set params
|
||||
|
||||
var params = this.params.concat({
|
||||
name: 'secret_key',
|
||||
value: ai1wm_export.secret_key
|
||||
}).concat({
|
||||
name: 'priority',
|
||||
value: 300
|
||||
}); // Set additional params
|
||||
|
||||
if (options) {
|
||||
params = params.concat(Ai1wm.Util.list(options));
|
||||
} // Clean
|
||||
|
||||
|
||||
$.ajax({
|
||||
url: ai1wm_export.ajax.url,
|
||||
type: 'POST',
|
||||
dataType: 'json',
|
||||
data: params,
|
||||
dataFilter: function dataFilter(data) {
|
||||
return Ai1wm.Util.json(data);
|
||||
}
|
||||
}).done(function () {
|
||||
// Unbinding the beforeunload event when we stop exporting
|
||||
$(window).unbind('beforeunload'); // Destroy modal
|
||||
|
||||
self.modal.destroy();
|
||||
}).fail(function (xhr) {
|
||||
var timeout = retries * 1000;
|
||||
|
||||
try {
|
||||
var json = Ai1wm.Util.json(xhr.responseText);
|
||||
|
||||
if (json) {
|
||||
var result = JSON.parse(json);
|
||||
var error = result.errors.pop();
|
||||
|
||||
if (error.message) {
|
||||
self.stopExport(true);
|
||||
self.setStatus({
|
||||
type: 'error',
|
||||
title: ai1wm_locale.unable_to_export,
|
||||
message: error.message
|
||||
});
|
||||
return;
|
||||
}
|
||||
}
|
||||
} catch (e) {}
|
||||
|
||||
if (retries >= 5) {
|
||||
self.stopExport(true);
|
||||
self.setStatus({
|
||||
type: 'error',
|
||||
title: ai1wm_locale.unable_to_export,
|
||||
message: ai1wm_locale.unable_to_stop_the_export
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
retries++;
|
||||
setTimeout(self.clean.bind(self, options, retries), timeout);
|
||||
});
|
||||
};
|
||||
|
||||
Export.prototype.getStatus = function () {
|
||||
var self = this; // Stop getting status
|
||||
|
||||
if (this.isExportStopped()) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.statusXhr = $.ajax({
|
||||
url: ai1wm_export.status.url,
|
||||
type: 'GET',
|
||||
dataType: 'json',
|
||||
cache: false,
|
||||
dataFilter: function dataFilter(data) {
|
||||
return Ai1wm.Util.json(data);
|
||||
}
|
||||
}).done(function (params) {
|
||||
if (params) {
|
||||
self.setStatus(params); // Next status
|
||||
|
||||
switch (params.type) {
|
||||
case 'done':
|
||||
case 'error':
|
||||
case 'download':
|
||||
// Unbinding beforeunload event when any case is performed
|
||||
$(window).unbind('beforeunload');
|
||||
return;
|
||||
}
|
||||
} // Export is not done yet, let's check status in 3 seconds
|
||||
|
||||
|
||||
setTimeout(self.getStatus.bind(self), 3000);
|
||||
}).fail(function () {
|
||||
// Export is not done yet, let's check status in 3 seconds
|
||||
setTimeout(self.getStatus.bind(self), 3000);
|
||||
});
|
||||
};
|
||||
|
||||
Export.prototype.setStatus = function (params) {
|
||||
this.modal.render(params);
|
||||
};
|
||||
|
||||
Export.prototype.onStop = function (options) {
|
||||
this.clean(options);
|
||||
};
|
||||
|
||||
Export.prototype.stopExport = function (isStopped) {
|
||||
try {
|
||||
if (isStopped && this.statusXhr) {
|
||||
this.statusXhr.abort();
|
||||
}
|
||||
} finally {
|
||||
this.isStopped = isStopped;
|
||||
}
|
||||
};
|
||||
|
||||
Export.prototype.isExportStopped = function () {
|
||||
return this.isStopped;
|
||||
};
|
||||
|
||||
module.exports = Export;
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 326:
|
||||
/***/ (function(module) {
|
||||
|
||||
/**
|
||||
* Copyright (C) 2014-2020 ServMask Inc.
|
||||
*
|
||||
* 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/>.
|
||||
*
|
||||
* ███████╗███████╗██████╗ ██╗ ██╗███╗ ███╗ █████╗ ███████╗██╗ ██╗
|
||||
* ██╔════╝██╔════╝██╔══██╗██║ ██║████╗ ████║██╔══██╗██╔════╝██║ ██╔╝
|
||||
* ███████╗█████╗ ██████╔╝██║ ██║██╔████╔██║███████║███████╗█████╔╝
|
||||
* ╚════██║██╔══╝ ██╔══██╗╚██╗ ██╔╝██║╚██╔╝██║██╔══██║╚════██║██╔═██╗
|
||||
* ███████║███████╗██║ ██║ ╚████╔╝ ██║ ╚═╝ ██║██║ ██║███████║██║ ██╗
|
||||
* ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
|
||||
*/
|
||||
var $ = jQuery;
|
||||
|
||||
var Modal = function Modal() {
|
||||
var self = this; // Error Modal
|
||||
|
||||
this.error = function (params) {
|
||||
// Create the modal container
|
||||
var container = $('<div></div>'); // Create section to hold title, message and action
|
||||
|
||||
var section = $('<section></section>'); // Create header to hold title
|
||||
|
||||
var header = $('<h1></h1>'); // Create paragraph to hold mesage
|
||||
|
||||
var message = $('<p></p>').html(params.message); // Create action section
|
||||
|
||||
var action = $('<div></div>'); // Create title
|
||||
|
||||
var title = $('<span></span>').addClass('ai1wm-title-red').text(params.title); // Create close button
|
||||
|
||||
var closeButton = $('<button type="button" class="ai1wm-button-red"></button>').on('click', function () {
|
||||
self.destroy();
|
||||
}); // Append text to close button
|
||||
|
||||
closeButton.append(ai1wm_locale.close_export); // Append close button to action
|
||||
|
||||
action.append(closeButton); // Append title to section
|
||||
|
||||
header.append(title); // Append header and message to section
|
||||
|
||||
section.append(header).append(message); // Append section and action to container
|
||||
|
||||
container.append(section).append(action); // Render modal
|
||||
|
||||
self.modal.html(container).show();
|
||||
self.modal.trigger('focus');
|
||||
self.overlay.show();
|
||||
}; // Info Modal
|
||||
|
||||
|
||||
this.info = function (params) {
|
||||
// Create the modal container
|
||||
var container = $('<div></div>'); // Create section to hold title, message and action
|
||||
|
||||
var section = $('<section></section>'); // Create header to hold loader
|
||||
|
||||
var header = $('<h1></h1>'); // Create paragraph to hold mesage
|
||||
|
||||
var message = $('<p></p>').html(params.message); // Create action section
|
||||
|
||||
var action = $('<div></div>'); // Create loader
|
||||
|
||||
var loader = $('<span class="ai1wm-loader"></span>'); // Create stop export
|
||||
|
||||
var stopButton = $('<button type="button" class="ai1wm-button-red"></button>').on('click', function () {
|
||||
stopButton.attr('disabled', 'disabled');
|
||||
self.onStop();
|
||||
}); // Append text to stop button
|
||||
|
||||
stopButton.append('<i class="ai1wm-icon-notification"></i> ' + ai1wm_locale.stop_export); // Append stop button to action
|
||||
|
||||
action.append(stopButton); // Append loader to header
|
||||
|
||||
header.append(loader); // Append header and message to section
|
||||
|
||||
section.append(header).append(message); // Append section and action to container
|
||||
|
||||
container.append(section).append(action); // Render modal
|
||||
|
||||
self.modal.html(container).show();
|
||||
self.modal.trigger('focus');
|
||||
self.overlay.show();
|
||||
}; // Done Modal
|
||||
|
||||
|
||||
this.done = function (params) {
|
||||
// Create the modal container
|
||||
var container = $('<div></div>'); // Create section to hold title, message and action
|
||||
|
||||
var section = $('<section></section>'); // Create header to hold title
|
||||
|
||||
var header = $('<h1></h1>'); // Create paragraph to hold mesage
|
||||
|
||||
var message = $('<p></p>').html(params.message); // Create action section
|
||||
|
||||
var action = $('<div></div>'); // Create title
|
||||
|
||||
var title = $('<span></span>').addClass('ai1wm-title-green').text(params.title); // Create close button
|
||||
|
||||
var closeButton = $('<button type="button" class="ai1wm-button-red"></button>').on('click', function () {
|
||||
self.destroy();
|
||||
}); // Append text to close button
|
||||
|
||||
closeButton.append(ai1wm_locale.close_export); // Append close button to action
|
||||
|
||||
action.append(closeButton); // Append title to section
|
||||
|
||||
header.append(title); // Append header and message to section
|
||||
|
||||
section.append(header).append(message); // Append section and action to container
|
||||
|
||||
container.append(section).append(action); // Render modal
|
||||
|
||||
self.modal.html(container).show();
|
||||
self.modal.trigger('focus');
|
||||
self.overlay.show();
|
||||
}; // Download Modal
|
||||
|
||||
|
||||
this.download = function (params) {
|
||||
// Create the modal container
|
||||
var container = $('<div></div>'); // Create section to hold title, message and action
|
||||
|
||||
var section = $('<section></section>'); // Create paragraph to hold mesage
|
||||
|
||||
var message = $('<p></p>').html(params.message); // Create action section
|
||||
|
||||
var action = $('<div></div>'); // Create close button
|
||||
|
||||
var closeButton = $('<button type="button" class="ai1wm-button-red"></button>').on('click', function () {
|
||||
self.destroy();
|
||||
}); // Append text to close button
|
||||
|
||||
closeButton.append(ai1wm_locale.close_export); // Append close button to action
|
||||
|
||||
action.append(closeButton); // Append message to section
|
||||
|
||||
section.append(message); // Append section and action to container
|
||||
|
||||
container.append(section).append(action); // Render modal
|
||||
|
||||
self.modal.html(container).show();
|
||||
self.modal.trigger('focus');
|
||||
self.overlay.show();
|
||||
}; // Create the overlay
|
||||
|
||||
|
||||
this.overlay = $('<div class="ai1wm-overlay"></div>'); // Create the modal container
|
||||
|
||||
this.modal = $('<div class="ai1wm-modal-container" role="dialog" tabindex="-1"></div>');
|
||||
$('body').append(this.overlay) // Append overlay to body
|
||||
.append(this.modal); // Append modal to body
|
||||
};
|
||||
|
||||
Modal.prototype.render = function (params) {
|
||||
$(document).trigger('ai1wm-export-status', params); // Show modal
|
||||
|
||||
switch (params.type) {
|
||||
case 'error':
|
||||
this.error(params);
|
||||
break;
|
||||
|
||||
case 'info':
|
||||
this.info(params);
|
||||
break;
|
||||
|
||||
case 'done':
|
||||
this.done(params);
|
||||
break;
|
||||
|
||||
case 'download':
|
||||
this.download(params);
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
||||
Modal.prototype.destroy = function () {
|
||||
this.modal.hide();
|
||||
this.overlay.hide();
|
||||
};
|
||||
|
||||
module.exports = Modal;
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 813:
|
||||
/***/ (function() {
|
||||
|
||||
/**
|
||||
* Copyright (C) 2014-2020 ServMask Inc.
|
||||
*
|
||||
* 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/>.
|
||||
*
|
||||
* ███████╗███████╗██████╗ ██╗ ██╗███╗ ███╗ █████╗ ███████╗██╗ ██╗
|
||||
* ██╔════╝██╔════╝██╔══██╗██║ ██║████╗ ████║██╔══██╗██╔════╝██║ ██╔╝
|
||||
* ███████╗█████╗ ██████╔╝██║ ██║██╔████╔██║███████║███████╗█████╔╝
|
||||
* ╚════██║██╔══╝ ██╔══██╗╚██╗ ██╔╝██║╚██╔╝██║██╔══██║╚════██║██╔═██╗
|
||||
* ███████║███████╗██║ ██║ ╚████╔╝ ██║ ╚═╝ ██║██║ ██║███████║██║ ██╗
|
||||
* ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
|
||||
*/
|
||||
(function ($) {
|
||||
$.fn.ai1wm_find_replace = function () {
|
||||
$(this).on('click', function (e) {
|
||||
e.preventDefault();
|
||||
var row = $('#ai1wm-queries > li:first').clone(); // Reset input values
|
||||
|
||||
row.find('input').val(''); // Reset ai1wm-query-find-text
|
||||
|
||||
row.find('.ai1wm-query-find-text').html('<text>'); // Reset ai1wm-query-replace-text
|
||||
|
||||
row.find('.ai1wm-query-replace-text').html('<another-text>');
|
||||
$('#ai1wm-queries > li').removeClass('ai1wm-open');
|
||||
$(row).addClass('ai1wm-open'); // Add new replace fields
|
||||
|
||||
$('#ai1wm-queries').append(row);
|
||||
$(row).ai1wm_query();
|
||||
$(row).find('p:first').on('click', function () {
|
||||
$(this).parent().toggleClass('ai1wm-open');
|
||||
});
|
||||
});
|
||||
return this;
|
||||
};
|
||||
})(jQuery);
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 88:
|
||||
/***/ (function() {
|
||||
|
||||
/**
|
||||
* Copyright (C) 2014-2020 ServMask Inc.
|
||||
*
|
||||
* 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/>.
|
||||
*
|
||||
* ███████╗███████╗██████╗ ██╗ ██╗███╗ ███╗ █████╗ ███████╗██╗ ██╗
|
||||
* ██╔════╝██╔════╝██╔══██╗██║ ██║████╗ ████║██╔══██╗██╔════╝██║ ██╔╝
|
||||
* ███████╗█████╗ ██████╔╝██║ ██║██╔████╔██║███████║███████╗█████╔╝
|
||||
* ╚════██║██╔══╝ ██╔══██╗╚██╗ ██╔╝██║╚██╔╝██║██╔══██║╚════██║██╔═██╗
|
||||
* ███████║███████╗██║ ██║ ╚████╔╝ ██║ ╚═╝ ██║██║ ██║███████║██║ ██╗
|
||||
* ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
|
||||
*/
|
||||
(function ($) {
|
||||
$.fn.ai1wm_query = function () {
|
||||
var findInput = $(this).find('input.ai1wm-query-find-input'),
|
||||
replaceInput = $(this).find('input.ai1wm-query-replace-input'),
|
||||
findText = $(this).find('small.ai1wm-query-find-text'),
|
||||
replaceText = $(this).find('small.ai1wm-query-replace-text');
|
||||
findInput.on('change paste input keypress keydown keyup', function () {
|
||||
var _inputValue = $(this).val().length > 0 ? $(this).val() : '<text>';
|
||||
|
||||
findText.text(_inputValue);
|
||||
});
|
||||
replaceInput.on('change paste input keypress keydown keyup', function () {
|
||||
var _inputValue = $(this).val().length > 0 ? $(this).val() : '<another-text>';
|
||||
|
||||
replaceText.text(_inputValue);
|
||||
});
|
||||
return this;
|
||||
};
|
||||
})(jQuery);
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 332:
|
||||
/***/ (function() {
|
||||
|
||||
/**
|
||||
* Copyright (C) 2014-2020 ServMask Inc.
|
||||
*
|
||||
* 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/>.
|
||||
*
|
||||
* ███████╗███████╗██████╗ ██╗ ██╗███╗ ███╗ █████╗ ███████╗██╗ ██╗
|
||||
* ██╔════╝██╔════╝██╔══██╗██║ ██║████╗ ████║██╔══██╗██╔════╝██║ ██╔╝
|
||||
* ███████╗█████╗ ██████╔╝██║ ██║██╔████╔██║███████║███████╗█████╔╝
|
||||
* ╚════██║██╔══╝ ██╔══██╗╚██╗ ██╔╝██║╚██╔╝██║██╔══██║╚════██║██╔═██╗
|
||||
* ███████║███████╗██║ ██║ ╚████╔╝ ██║ ╚═╝ ██║██║ ██║███████║██║ ██╗
|
||||
* ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
|
||||
*/
|
||||
jQuery(document).ready(function ($) {
|
||||
'use strict'; // Idea
|
||||
|
||||
$('#ai1wm-feedback-type-link-1').on('click', function () {
|
||||
var radio = $('#ai1wm-feedback-type-1');
|
||||
|
||||
if (radio.is(':checked')) {
|
||||
radio.attr('checked', false);
|
||||
} else {
|
||||
radio.attr('checked', true);
|
||||
}
|
||||
}); // Help
|
||||
|
||||
$('#ai1wm-feedback-type-2').on('click', function () {
|
||||
// Hide other options
|
||||
$('#ai1wm-feedback-type-1').closest('li').hide(); // Change placeholder message
|
||||
|
||||
$('.ai1wm-feedback-form').find('.ai1wm-feedback-message').attr('placeholder', ai1wm_locale.how_may_we_help_you); // Show feedback form
|
||||
|
||||
$('.ai1wm-feedback-form').fadeIn();
|
||||
}); // Cancel feedback form
|
||||
|
||||
$('#ai1wm-feedback-cancel').on('click', function (e) {
|
||||
$('.ai1wm-feedback-form').fadeOut(function () {
|
||||
$('.ai1wm-feedback-type').attr('checked', false).closest('li').show();
|
||||
});
|
||||
e.preventDefault();
|
||||
}); // Send feedback form
|
||||
|
||||
$('#ai1wm-feedback-submit').on('click', function (e) {
|
||||
var self = $(this);
|
||||
var spinner = self.next();
|
||||
var type = $('.ai1wm-feedback-type:checked').val();
|
||||
var email = $('.ai1wm-feedback-email').val();
|
||||
var message = $('.ai1wm-feedback-message').val();
|
||||
var terms = $('.ai1wm-feedback-terms').is(':checked');
|
||||
self.attr('disabled', true);
|
||||
spinner.css('visibility', 'visible');
|
||||
$.ajax({
|
||||
url: ai1wm_feedback.ajax.url,
|
||||
type: 'POST',
|
||||
dataType: 'json',
|
||||
async: true,
|
||||
data: {
|
||||
secret_key: ai1wm_feedback.secret_key,
|
||||
ai1wm_type: type,
|
||||
ai1wm_email: email,
|
||||
ai1wm_message: message,
|
||||
ai1wm_terms: +terms
|
||||
},
|
||||
dataFilter: function dataFilter(data) {
|
||||
return Ai1wm.Util.json(data);
|
||||
}
|
||||
}).done(function (data) {
|
||||
self.attr('disabled', false);
|
||||
spinner.css('visibility', 'hidden');
|
||||
|
||||
if (data.errors.length > 0) {
|
||||
$('.ai1wm-feedback .ai1wm-message').remove();
|
||||
var errorMessage = $('<div />').addClass('ai1wm-message ai1wm-error-message');
|
||||
$.each(data.errors, function (key, value) {
|
||||
errorMessage.append($('<p />').text(value));
|
||||
});
|
||||
$('.ai1wm-feedback').prepend(errorMessage);
|
||||
} else {
|
||||
var successMessage = $('<div />').addClass('ai1wm-message ai1wm-success-message');
|
||||
successMessage.append($('<p />').text(ai1wm_locale.thanks_for_submitting_your_feedback));
|
||||
$('.ai1wm-feedback').html(successMessage);
|
||||
}
|
||||
});
|
||||
e.preventDefault();
|
||||
});
|
||||
});
|
||||
|
||||
/***/ })
|
||||
|
||||
/******/ });
|
||||
/************************************************************************/
|
||||
/******/ // The module cache
|
||||
/******/ var __webpack_module_cache__ = {};
|
||||
/******/
|
||||
/******/ // The require function
|
||||
/******/ function __webpack_require__(moduleId) {
|
||||
/******/ // Check if module is in cache
|
||||
/******/ if(__webpack_module_cache__[moduleId]) {
|
||||
/******/ return __webpack_module_cache__[moduleId].exports;
|
||||
/******/ }
|
||||
/******/ // Create a new module (and put it into the cache)
|
||||
/******/ var module = __webpack_module_cache__[moduleId] = {
|
||||
/******/ // no module.id needed
|
||||
/******/ // no module.loaded needed
|
||||
/******/ exports: {}
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // Execute the module function
|
||||
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
||||
/******/
|
||||
/******/ // Return the exports of the module
|
||||
/******/ return module.exports;
|
||||
/******/ }
|
||||
/******/
|
||||
/************************************************************************/
|
||||
/******/ /* webpack/runtime/global */
|
||||
/******/ !function() {
|
||||
/******/ __webpack_require__.g = (function() {
|
||||
/******/ if (typeof globalThis === 'object') return globalThis;
|
||||
/******/ try {
|
||||
/******/ return this || new Function('return this')();
|
||||
/******/ } catch (e) {
|
||||
/******/ if (typeof window === 'object') return window;
|
||||
/******/ }
|
||||
/******/ })();
|
||||
/******/ }();
|
||||
/******/
|
||||
/************************************************************************/
|
||||
!function() {
|
||||
/**
|
||||
* Copyright (C) 2014-2020 ServMask Inc.
|
||||
*
|
||||
* 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/>.
|
||||
*
|
||||
* ███████╗███████╗██████╗ ██╗ ██╗███╗ ███╗ █████╗ ███████╗██╗ ██╗
|
||||
* ██╔════╝██╔════╝██╔══██╗██║ ██║████╗ ████║██╔══██╗██╔════╝██║ ██╔╝
|
||||
* ███████╗█████╗ ██████╔╝██║ ██║██╔████╔██║███████║███████╗█████╔╝
|
||||
* ╚════██║██╔══╝ ██╔══██╗╚██╗ ██╔╝██║╚██╔╝██║██╔══██║╚════██║██╔═██╗
|
||||
* ███████║███████╗██║ ██║ ╚████╔╝ ██║ ╚═╝ ██║██║ ██║███████║██║ ██╗
|
||||
* ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
|
||||
*/
|
||||
var Query = __webpack_require__(88),
|
||||
FindReplace = __webpack_require__(813),
|
||||
Feedback = __webpack_require__(332),
|
||||
Export = __webpack_require__(12);
|
||||
|
||||
jQuery(document).ready(function ($) {
|
||||
'use strict';
|
||||
|
||||
var model = new Export(); // Export to file
|
||||
|
||||
$('#ai1wm-export-file').on('click', function (e) {
|
||||
var storage = Ai1wm.Util.random(12);
|
||||
var options = Ai1wm.Util.form('#ai1wm-export-form').concat({
|
||||
name: 'storage',
|
||||
value: storage
|
||||
}).concat({
|
||||
name: 'file',
|
||||
value: 1
|
||||
}); // Set global params
|
||||
|
||||
model.setParams(options); // Start export
|
||||
|
||||
model.start();
|
||||
e.preventDefault();
|
||||
});
|
||||
$('.ai1wm-accordion > .ai1wm-title').on('click', function () {
|
||||
$(this).parent().toggleClass('ai1wm-active');
|
||||
});
|
||||
$('#ai1wm-add-new-replace-button').ai1wm_find_replace();
|
||||
$('.ai1wm-expandable > p:first, .ai1wm-expandable > h4:first, .ai1wm-expandable > div.ai1wm-button-main').on('click', function () {
|
||||
$(this).parent().toggleClass('ai1wm-open');
|
||||
});
|
||||
$('.ai1wm-query').ai1wm_query();
|
||||
});
|
||||
__webpack_require__.g.Ai1wm = jQuery.extend({}, __webpack_require__.g.Ai1wm, {
|
||||
Query: Query,
|
||||
FindReplace: FindReplace,
|
||||
Feedback: Feedback,
|
||||
Export: Export
|
||||
});
|
||||
}();
|
||||
/******/ })()
|
||||
;
|
||||
1356
wp-content/plugins/all-in-one-wp-migration/lib/view/assets/javascript/import.min.js
vendored
Normal file
1356
wp-content/plugins/all-in-one-wp-migration/lib/view/assets/javascript/import.min.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user