deleted plugin `WP-Matomo Integration` version 1.0.24

This commit is contained in:
KawaiiPunk 2021-04-08 18:46:38 +00:00 committed by Gitium
parent ca7eb56a01
commit d1bf360aac
151 changed files with 0 additions and 55149 deletions

View File

@ -1,2 +0,0 @@
.idea/

View File

@ -1,675 +0,0 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
{one line to give the program's name and a brief idea of what it does.}
Copyright (C) {year} {name of author}
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
{project} Copyright (C) {year} {fullname}
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.

View File

@ -1,9 +0,0 @@
# WP-Matomo (former WP-Piwik)
This [WordPress](https://wordpress.org) plugin adds a [Matomo](http://matomo.org) stats site to your blog's dashboard. It's also able to add the Matomo tracking code to your blog.
## How to use this plugin
To use this plugin you will need your own Matomo instance. If you do not already have a Matomo setup, you have two simple options: use either [self-hosted](http://matomo.org/) or [cloud-hosted](http://matomo.org/hosting/).
This repository was created to develop and maintain WP-Matomo (WP-Piwik). Please see the WordPress plugin directory if you like to use this plugin: https://wordpress.org/plugins/wp-piwik/

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

File diff suppressed because it is too large Load Diff

View File

@ -1,26 +0,0 @@
<?php
namespace WP_Piwik;
abstract class Admin {
protected static $wpPiwik, $pageID, $settings;
public function __construct($wpPiwik, $settings) {
self::$wpPiwik = $wpPiwik;
self::$settings = $settings;
}
abstract public function show();
abstract public function printAdminScripts();
abstract public function extendAdminHeader();
public function printAdminStyles() {
wp_enqueue_style('wp-piwik', self::$wpPiwik->getPluginURL().'css/wp-piwik.css', array(), self::$wpPiwik->getPluginVersion());
}
public function onLoad() {}
}

View File

@ -1,25 +0,0 @@
<?php
namespace WP_Piwik\Admin;
class Network extends \WP_Piwik\Admin\Statistics {
public function show() {
parent::show();
}
public function printAdminScripts() {
wp_enqueue_script('wp-piwik', self::$wpPiwik->getPluginURL().'js/wp-piwik.js', array(), self::$wpPiwik->getPluginVersion(), true);
wp_enqueue_script('wp-piwik-jqplot', self::$wpPiwik->getPluginURL().'js/jqplot/wp-piwik.jqplot.js',array('jquery'), self::$wpPiwik->getPluginVersion());
}
public function extendAdminHeader() {
echo '<!--[if IE]><script language="javascript" type="text/javascript" src="'.(parent::$wpPiwik->getPluginURL()).'js/jqplot/excanvas.min.js"></script><![endif]-->';
echo '<link rel="stylesheet" href="'.(parent::$wpPiwik->getPluginURL()).'js/jqplot/jquery.jqplot.min.css" type="text/css"/>';
echo '<script type="text/javascript">var $j = jQuery.noConflict();</script>';
}
public function onLoad() {
self::$wpPiwik->onloadStatsPage(self::$pageID);
}
}

View File

@ -1,720 +0,0 @@
<?php
namespace WP_Piwik\Admin;
/**
* WordPress Admin settings page
*
* @package WP_Piwik\Admin
* @author Andr&eacute; Br&auml;kling <webmaster@braekling.de>
*/
class Settings extends \WP_Piwik\Admin {
/**
* Builds and displays the settings page
*/
public function show() {
if (isset($_GET['sitebrowser']) && $_GET['sitebrowser']) {
new \WP_Piwik\Admin\Sitebrowser(self::$wpPiwik);
return;
}
if (isset($_GET['clear']) && $_GET['clear']) {
$this->clear($_GET['clear'] == 2);
self::$wpPiwik->resetRequest();
echo '<form method="post" action="?page='.htmlentities($_GET['page']).'"><input type="submit" value="'.__('Reload', 'wp-piwik').'" /></form>';
return;
} elseif (self::$wpPiwik->isConfigSubmitted()) {
$this->showBox ( 'updated', 'yes', __ ( 'Changes saved.' ) );
self::$wpPiwik->resetRequest();
self::$wpPiwik->updateTrackingCode();
}
global $wp_roles;
?>
<div id="plugin-options-wrap" class="widefat">
<?php
echo $this->getHeadline ( 1, 'admin-generic', 'Settings', true );
if (isset($_GET['testscript']) && $_GET['testscript'])
$this->runTestscript();
?>
<?php
if (self::$wpPiwik->isConfigured ()) {
$piwikVersion = self::$wpPiwik->request ( 'global.getPiwikVersion' );
if (is_array ( $piwikVersion ) && isset( $piwikVersion['value'] ))
$piwikVersion = $piwikVersion['value'];
if (! empty ( $piwikVersion ) && !is_array( $piwikVersion ))
$this->showDonation();
}
?>
<form method="post" action="?page=<?php echo htmlentities($_GET['page']); ?>">
<input type="hidden" name="wp-piwik[revision]" value="<?php echo self::$settings->getGlobalOption('revision'); ?>" />
<?php wp_nonce_field('wp-piwik_settings'); ?>
<table class="wp-piwik-form">
<tbody>
<?php
$submitButton = '<tr><td colspan="2"><p class="submit"><input name="Submit" type="submit" class="button-primary" value="' . esc_attr__ ( 'Save Changes' ) . '" /></p></td></tr>';
printf ( '<tr><td colspan="2">%s</td></tr>', __ ( 'Thanks for using WP-Matomo!', 'wp-piwik' ) );
if (self::$wpPiwik->isConfigured ()) {
if (! empty ( $piwikVersion ) && !is_array( $piwikVersion )) {
$this->showText ( sprintf ( __ ( 'WP-Matomo %s is successfully connected to Matomo %s.', 'wp-piwik' ), self::$wpPiwik->getPluginVersion (), $piwikVersion ) . ' ' . (! self::$wpPiwik->isNetworkMode () ? sprintf ( __ ( 'You are running WordPress %s.', 'wp-piwik' ), get_bloginfo ( 'version' ) ) : sprintf ( __ ( 'You are running a WordPress %s blog network (WPMU). WP-Matomo will handle your sites as different websites.', 'wp-piwik' ), get_bloginfo ( 'version' ) )) );
} else {
$errorMessage = \WP_Piwik\Request::getLastError();
if ( empty( $errorMessage ) )
$this->showBox ( 'error', 'no', sprintf ( __ ( 'WP-Matomo %s was not able to connect to Matomo using your configuration. Check the &raquo;Connect to Matomo&laquo; section below.', 'wp-piwik' ), self::$wpPiwik->getPluginVersion () ) );
else
$this->showBox ( 'error', 'no', sprintf ( __ ( 'WP-Matomo %s was not able to connect to Matomo using your configuration. During connection the following error occured: <br /><code>%s</code>', 'wp-piwik' ), self::$wpPiwik->getPluginVersion (), $errorMessage ) );
}
} else
$this->showBox ( 'error', 'no', sprintf ( __ ( 'WP-Matomo %s has to be connected to Matomo first. Check the &raquo;Connect to Matomo&laquo; section below.', 'wp-piwik' ), self::$wpPiwik->getPluginVersion () ) );
$tabs ['connect'] = array (
'icon' => 'admin-plugins',
'name' => __('Connect to Matomo', 'wp-piwik')
);
if (self::$wpPiwik->isConfigured ()) {
$tabs ['statistics'] = array (
'icon' => 'chart-pie',
'name' => __('Show Statistics', 'wp-piwik')
);
$tabs ['tracking'] = array (
'icon' => 'location-alt',
'name' => __('Enable Tracking', 'wp-piwik')
);
}
$tabs ['expert'] = array (
'icon' => 'shield',
'name' => __('Expert Settings', 'wp-piwik')
);
$tabs ['support'] = array (
'icon' => 'lightbulb',
'name' => __('Support', 'wp-piwik')
);
$tabs ['credits'] = array (
'icon' => 'groups',
'name' => __('Credits', 'wp-piwik')
);
echo '<tr><td colspan="2"><h2 class="nav-tab-wrapper">';
foreach ( $tabs as $tab => $details ) {
$class = ($tab == 'connect') ? ' nav-tab-active' : '';
echo '<a style="cursor:pointer;" id="tab-' . $tab . '" class="nav-tab' . $class . '" onclick="javascript:$j(\'table.wp-piwik_menu-tab\').addClass(\'hidden\');$j(\'#' . $tab . '\').removeClass(\'hidden\');$j(\'a.nav-tab\').removeClass(\'nav-tab-active\');$j(\'#tab-' . $tab . '\').addClass(\'nav-tab-active\');">';
$this->showHeadline ( 0, $details ['icon'], $details ['name'] );
echo "</a>";
}
echo '</h2></td></tr></tbody></table><table id="connect" class="wp-piwik_menu-tab"><tbody>';
if (! self::$wpPiwik->isConfigured ())
$this->showBox ( 'updated', 'info', sprintf ( '%s <a href="%s">%s</a> %s <a href="%s">%s</a>.', __ ( 'WP-Matomo is a WordPress plugin to show a selection of Matomo stats in your WordPress admin dashboard and to add and configure your Matomo tracking code. To use this you will need your own Matomo instance. If you do not already have a Matomo setup, you have two simple options: use either', 'wp-piwik' ), 'http://piwik.org/', __ ( 'a self-hosted Matomo', 'wp-piwik' ), __ ( 'or', 'wp-piwik' ), 'https://www.innocraft.cloud/?pk_campaign=WP-Matomo', __ ( 'a cloud-hosted Matomo by InnoCraft', 'wp-piwik' ) ) );
if (! function_exists ( 'curl_init' ) && ! ini_get ( 'allow_url_fopen' ))
$this->showBox ( 'error', 'no', __ ( 'Neither cURL nor fopen are available. So WP-Matomo can not use the HTTP API and not connect to InnoCraft Cloud.' ) . ' ' . sprintf ( '<a href="%s">%s.</a>', 'https://wordpress.org/plugins/wp-piwik/faq/', __ ( 'More information', 'wp-piwik' ) ) );
$description = sprintf ( '%s<br /><strong>%s:</strong> %s<br /><strong>%s:</strong> %s<br /><strong>%s:</strong> %s', __ ( 'You can choose between three connection methods:', 'wp-piwik' ), __ ( 'Self-hosted (HTTP API, default)', 'wp-piwik' ), __ ( 'This is the default option for a self-hosted Matomo and should work for most configurations. WP-Matomo will connect to Matomo using http(s).', 'wp-piwik' ), __ ( 'Self-hosted (PHP API)', 'wp-piwik' ), __ ( 'Choose this, if your self-hosted Matomo and WordPress are running on the same machine and you know the full server path to your Matomo instance.', 'wp-piwik' ), __ ( 'Cloud-hosted', 'wp-piwik' ), __ ( 'If you are using a cloud-hosted Matomo by InnoCraft, you can simply use this option. Be carefull to choose the option which fits to your cloud domain (matomo.cloud or innocraft.cloud).', 'wp-piwik' ) );
$this->showSelect ( 'piwik_mode', __ ( 'Matomo Mode', 'wp-piwik' ), array (
'disabled' => __ ( 'Disabled (WP-Matomo will not connect to Matomo)', 'wp-piwik' ),
'http' => __ ( 'Self-hosted (HTTP API, default)', 'wp-piwik' ),
'php' => __ ( 'Self-hosted (PHP API)', 'wp-piwik' ),
'cloud-matomo' => __('Cloud-hosted (Innocraft Cloud, *.matomo.cloud)', 'wp-piwik'),
'cloud' => __ ( 'Cloud-hosted (InnoCraft Cloud, *.innocraft.cloud)', 'wp-piwik' )
), $description, '$j(\'tr.wp-piwik-mode-option\').addClass(\'hidden\'); $j(\'#wp-piwik-mode-option-\' + $j(\'#piwik_mode\').val()).removeClass(\'hidden\');', false, '', self::$wpPiwik->isConfigured () );
$this->showInput ( 'piwik_url', __ ( 'Matomo URL', 'wp-piwik' ), __( 'Enter your Matomo URL. This is the same URL you use to access your Matomo instance, e.g. http://www.example.com/matomo/.', 'wp-piwik' ), self::$settings->getGlobalOption ( 'piwik_mode' ) != 'http', 'wp-piwik-mode-option', 'http', self::$wpPiwik->isConfigured (), true );
$this->showInput ( 'piwik_path', __ ( 'Matomo path', 'wp-piwik' ), __( 'Enter the file path to your Matomo instance, e.g. /var/www/matomo/.', 'wp-piwik' ), self::$settings->getGlobalOption ( 'piwik_mode' ) != 'php', 'wp-piwik-mode-option', 'php', self::$wpPiwik->isConfigured (), true );
$this->showInput ( 'piwik_user', __ ( 'Innocraft subdomain', 'wp-piwik' ), __( 'Enter your InnoCraft Cloud subdomain. It is also part of your URL: https://SUBDOMAIN.innocraft.cloud.', 'wp-piwik' ), self::$settings->getGlobalOption ( 'piwik_mode' ) != 'cloud', 'wp-piwik-mode-option', 'cloud', self::$wpPiwik->isConfigured () );
$this->showInput ( 'matomo_user', __ ( 'Matomo subdomain', 'wp-piwik' ), __( 'Enter your Matomo Cloud subdomain. It is also part of your URL: https://SUBDOMAIN.matomo.cloud.', 'wp-piwik' ), self::$settings->getGlobalOption ( 'piwik_mode' ) != 'cloud-matomo', 'wp-piwik-mode-option', 'cloud-matomo', self::$wpPiwik->isConfigured () );
$this->showInput ( 'piwik_token', __ ( 'Auth token', 'wp-piwik' ), __( 'Enter your Matomo auth token here. It is an alphanumerical code like 0a1b2c34d56e78901fa2bc3d45678efa.', 'wp-piwik' ).' '.sprintf ( __ ( 'See %sWP-Matomo FAQ%s.', 'wp-piwik' ), '<a href="https://wordpress.org/plugins/wp-piwik/faq/" target="_BLANK">', '</a>' ), false, '', '', self::$wpPiwik->isConfigured (), true );
// Site configuration
$piwikSiteId = self::$wpPiwik->isConfigured () ? self::$wpPiwik->getPiwikSiteId () : false;
if (! self::$wpPiwik->isNetworkMode() ) {
$this->showCheckbox ( 'auto_site_config', __ ( 'Auto config', 'wp-piwik' ), __ ( 'Check this to automatically choose your blog from your Matomo sites by URL. If your blog is not added to Matomo yet, WP-Matomo will add a new site.', 'wp-piwik' ), false, '$j(\'tr.wp-piwik-auto-option\').toggle(\'hidden\');' . ($piwikSiteId ? '$j(\'#site_id\').val(' . $piwikSiteId . ');' : '') );
if (self::$wpPiwik->isConfigured ()) {
$piwikSiteList = self::$wpPiwik->getPiwikSiteDetails ();
if (isset($piwikSiteList['result']) && $piwikSiteList['result'] == 'error') {
$this->showBox ( 'error', 'no', sprintf ( __ ( 'WP-Matomo %s was not able to get sites with at least view access: <br /><code>%s</code>', 'wp-piwik' ), self::$wpPiwik->getPluginVersion (), $errorMessage ) );
} else {
if (is_array($piwikSiteList))
foreach ($piwikSiteList as $details)
$piwikSiteDetails[$details['idsite']] = $details;
unset($piwikSiteList);
if ($piwikSiteId != 'n/a' && isset($piwikSiteDetails) && is_array($piwikSiteDetails))
$piwikSiteDescription = $piwikSiteDetails [$piwikSiteId] ['name'] . ' (' . $piwikSiteDetails [$piwikSiteId] ['main_url'] . ')';
else
$piwikSiteDescription = 'n/a';
echo '<tr class="wp-piwik-auto-option' . (!self::$settings->getGlobalOption('auto_site_config') ? ' hidden' : '') . '"><th scope="row">' . __('Determined site', 'wp-piwik') . ':</th><td>' . $piwikSiteDescription . '</td></tr>';
if (isset ($piwikSiteDetails) && is_array($piwikSiteDetails))
foreach ($piwikSiteDetails as $key => $siteData)
$siteList [$siteData['idsite']] = $siteData ['name'] . ' (' . $siteData ['main_url'] . ')';
if (isset($siteList))
$this->showSelect('site_id', __('Select site', 'wp-piwik'), $siteList, 'Choose the Matomo site corresponding to this blog.', '', self::$settings->getGlobalOption('auto_site_config'), 'wp-piwik-auto-option', true, false);
}
}
} else echo '<tr class="hidden"><td colspan="2"><input type="hidden" name="wp-piwik[auto_site_config]" value="1" /></td></tr>';
echo $submitButton;
echo '</tbody></table><table id="statistics" class="wp-piwik_menu-tab hidden"><tbody>';
// Stats configuration
$this->showSelect ( 'default_date', __ ( 'Matomo default date', 'wp-piwik' ), array (
'today' => __ ( 'Today', 'wp-piwik' ),
'yesterday' => __ ( 'Yesterday', 'wp-piwik' ),
'current_month' => __ ( 'Current month', 'wp-piwik' ),
'last_month' => __ ( 'Last month', 'wp-piwik' ),
'current_week' => __ ( 'Current week', 'wp-piwik' ),
'last_week' => __ ( 'Last week', 'wp-piwik' )
), __ ( 'Default date shown on statistics page.', 'wp-piwik' ) );
$this->showCheckbox ( 'stats_seo', __ ( 'Show SEO data', 'wp-piwik' ), __ ( 'Display SEO ranking data on statistics page.', 'wp-piwik' ) . ' (' . __ ( 'Slow!', 'wp-piwik' ) . ')' );
$this->showCheckbox ( 'stats_ecommerce', __ ( 'Show e-commerce data', 'wp-piwik' ), __ ( 'Display e-commerce data on statistics page.', 'wp-piwik' ) );
$this->showSelect ( 'dashboard_widget', __ ( 'Dashboard overview', 'wp-piwik' ), array (
'disabled' => __ ( 'Disabled', 'wp-piwik' ),
'yesterday' => __ ( 'Yesterday', 'wp-piwik' ),
'today' => __ ( 'Today', 'wp-piwik' ),
'last30' => __ ( 'Last 30 days', 'wp-piwik' )
), __ ( 'Enable WP-Matomo dashboard widget &quot;Overview&quot;.', 'wp-piwik' ) );
$this->showCheckbox ( 'dashboard_chart', __ ( 'Dashboard graph', 'wp-piwik' ), __ ( 'Enable WP-Matomo dashboard widget &quot;Graph&quot;.', 'wp-piwik' ) );
$this->showCheckbox ( 'dashboard_seo', __ ( 'Dashboard SEO', 'wp-piwik' ), __ ( 'Enable WP-Matomo dashboard widget &quot;SEO&quot;.', 'wp-piwik' ) . ' (' . __ ( 'Slow!', 'wp-piwik' ) . ')' );
$this->showCheckbox ( 'dashboard_ecommerce', __ ( 'Dashboard e-commerce', 'wp-piwik' ), __ ( 'Enable WP-Matomo dashboard widget &quot;E-commerce&quot;.', 'wp-piwik' ) );
$this->showCheckbox ( 'toolbar', __ ( 'Show graph on WordPress Toolbar', 'wp-piwik' ), __ ( 'Display a last 30 days visitor graph on WordPress\' toolbar.', 'wp-piwik' ) );
echo '<tr><th scope="row"><label for="capability_read_stats">' . __ ( 'Display stats to', 'wp-piwik' ) . '</label>:</th><td>';
$filter = self::$settings->getGlobalOption ( 'capability_read_stats' );
foreach ( $wp_roles->role_names as $key => $name ) {
echo '<input type="checkbox" ' . (isset ( $filter [$key] ) && $filter [$key] ? 'checked="checked" ' : '') . 'value="1" onchange="$j(\'#capability_read_stats-' . $key . '-input\').val(this.checked?1:0);" />';
echo '<input id="capability_read_stats-' . $key . '-input" type="hidden" name="wp-piwik[capability_read_stats][' . $key . ']" value="' . ( int ) (isset ( $filter [$key] ) && $filter [$key]) . '" />';
echo $name . ' &nbsp; ';
}
echo '<span class="dashicons dashicons-editor-help" onclick="$j(\'#capability_read_stats-desc\').toggleClass(\'hidden\');"></span> <p class="description hidden" id="capability_read_stats-desc">' . __ ( 'Choose user roles allowed to see the statistics page.', 'wp-piwik' ) . '</p></td></tr>';
$this->showCheckbox ( 'perpost_stats', __ ( 'Show per post stats', 'wp-piwik' ), __ ( 'Show stats about single posts at the post edit admin page.', 'wp-piwik' ) );
$this->showCheckbox ( 'piwik_shortcut', __ ( 'Matomo shortcut', 'wp-piwik' ), __ ( 'Display a shortcut to Matomo itself.', 'wp-piwik' ) );
$this->showInput ( 'plugin_display_name', __ ( 'WP-Matomo display name', 'wp-piwik' ), __ ( 'Plugin name shown in WordPress.', 'wp-piwik' ) );
$this->showCheckbox ( 'shortcodes', __ ( 'Enable shortcodes', 'wp-piwik' ), __ ( 'Enable shortcodes in post or page content.', 'wp-piwik' ) );
echo $submitButton;
echo '</tbody></table><table id="tracking" class="wp-piwik_menu-tab hidden"><tbody>';
// Tracking Configuration
$isNotTracking = self::$settings->getGlobalOption ( 'track_mode' ) == 'disabled';
$isNotGeneratedTracking = $isNotTracking || self::$settings->getGlobalOption ( 'track_mode' ) == 'manually';
$fullGeneratedTrackingGroup = 'wp-piwik-track-option wp-piwik-track-option-default wp-piwik-track-option-js wp-piwik-track-option-proxy';
$description = sprintf ( '%s<br /><strong>%s:</strong> %s<br /><strong>%s:</strong> %s<br /><strong>%s:</strong> %s<br /><strong>%s:</strong> %s<br /><strong>%s:</strong> %s', __ ( 'You can choose between four tracking code modes:', 'wp-piwik' ), __ ( 'Disabled', 'wp-piwik' ), __ ( 'WP-Matomo will not add the tracking code. Use this, if you want to add the tracking code to your template files or you use another plugin to add the tracking code.', 'wp-piwik' ), __ ( 'Default tracking', 'wp-piwik' ), __ ( 'WP-Matomo will use Matomo\'s standard tracking code.', 'wp-piwik' ), __ ( 'Use js/index.php', 'wp-piwik' ), __ ( 'You can choose this tracking code, to deliver a minified proxy code and to avoid using the files called piwik.js or piwik.php.', 'wp-piwik' ).' '.sprintf( __( 'See %sreadme file%s.', 'wp-piwik' ), '<a href="http://demo.piwik.org/js/README" target="_BLANK">', '</a>'), __ ( 'Use proxy script', 'wp-piwik' ), __ ( 'Use this tracking code to not reveal the Matomo server URL.', 'wp-piwik' ) . ' ' . sprintf ( __ ( 'See %sMatomo FAQ%s.', 'wp-piwik' ), '<a href="http://piwik.org/faq/how-to/#faq_132" target="_BLANK">', '</a>' ) , __ ( 'Enter manually', 'wp-piwik' ), __ ( 'Enter your own tracking code manually. You can choose one of the prior options, pre-configure your tracking code and switch to manually editing at last.', 'wp-piwik' ).( self::$wpPiwik->isNetworkMode() ? ' '.__ ( 'Use the placeholder {ID} to add the Matomo site ID.', 'wp-piwik' ) : '' ) );
$this->showSelect ( 'track_mode', __ ( 'Add tracking code', 'wp-piwik' ), array (
'disabled' => __ ( 'Disabled', 'wp-piwik' ),
'default' => __ ( 'Default tracking', 'wp-piwik' ),
'js' => __ ( 'Use js/index.php', 'wp-piwik' ),
'proxy' => __ ( 'Use proxy script', 'wp-piwik' ),
'manually' => __ ( 'Enter manually', 'wp-piwik' )
), $description, '$j(\'tr.wp-piwik-track-option\').addClass(\'hidden\'); $j(\'tr.wp-piwik-track-option-\' + $j(\'#track_mode\').val()).removeClass(\'hidden\'); $j(\'#tracking_code, #noscript_code\').prop(\'readonly\', $j(\'#track_mode\').val() != \'manually\');' );
$this->showTextarea ( 'tracking_code', __ ( 'Tracking code', 'wp-piwik' ), 15, 'This is a preview of your current tracking code. If you choose to enter your tracking code manually, you can change it here.', $isNotTracking, 'wp-piwik-track-option wp-piwik-track-option-default wp-piwik-track-option-js wp-piwik-track-option-proxy wp-piwik-track-option-manually', true, '', (self::$settings->getGlobalOption ( 'track_mode' ) != 'manually'), false );
$this->showSelect ( 'track_codeposition', __ ( 'JavaScript code position', 'wp-piwik' ), array (
'footer' => __ ( 'Footer', 'wp-piwik' ),
'header' => __ ( 'Header', 'wp-piwik' )
), __ ( 'Choose whether the JavaScript code is added to the footer or the header.', 'wp-piwik' ), '', $isNotTracking, 'wp-piwik-track-option wp-piwik-track-option-default wp-piwik-track-option-js wp-piwik-track-option-proxy wp-piwik-track-option-manually' );
$this->showTextarea ( 'noscript_code', __ ( 'Noscript code', 'wp-piwik' ), 2, 'This is a preview of your &lt;noscript&gt; code which is part of your tracking code.', self::$settings->getGlobalOption ( 'track_mode' ) == 'proxy', 'wp-piwik-track-option wp-piwik-track-option-default wp-piwik-track-option-js wp-piwik-track-option-manually', true, '', (self::$settings->getGlobalOption ( 'track_mode' ) != 'manually'), false );
$this->showCheckbox ( 'track_noscript', __ ( 'Add &lt;noscript&gt;', 'wp-piwik' ), __ ( 'Adds the &lt;noscript&gt; code to your footer.', 'wp-piwik' ) . ' ' . __ ( 'Disabled in proxy mode.', 'wp-piwik' ), self::$settings->getGlobalOption ( 'track_mode' ) == 'proxy', 'wp-piwik-track-option wp-piwik-track-option-default wp-piwik-track-option-js wp-piwik-track-option-manually' );
$this->showCheckbox ( 'track_nojavascript', __ ( 'Add rec parameter to noscript code', 'wp-piwik' ), __ ( 'Enable tracking for visitors without JavaScript (not recommended).', 'wp-piwik' ) . ' ' . sprintf ( __ ( 'See %sMatomo FAQ%s.', 'wp-piwik' ), '<a href="http://piwik.org/faq/how-to/#faq_176" target="_BLANK">', '</a>' ) . ' ' . __ ( 'Disabled in proxy mode.', 'wp-piwik' ), self::$settings->getGlobalOption ( 'track_mode' ) == 'proxy', 'wp-piwik-track-option wp-piwik-track-option-default wp-piwik-track-option-js wp-piwik-track-option-manually' );
$this->showSelect ( 'track_content', __ ( 'Enable content tracking', 'wp-piwik' ), array (
'disabled' => __ ( 'Disabled', 'wp-piwik' ),
'all' => __ ( 'Track all content blocks', 'wp-piwik' ),
'visible' => __ ( 'Track only visible content blocks', 'wp-piwik' )
), __ ( 'Content tracking allows you to track interaction with the content of a web page or application.' ) . ' ' . sprintf ( __ ( 'See %sMatomo documentation%s.', 'wp-piwik' ), '<a href="https://developer.piwik.org/guides/content-tracking" target="_BLANK">', '</a>' ), '', $isNotTracking, $fullGeneratedTrackingGroup . ' wp-piwik-track-option-manually' );
$this->showCheckbox ( 'track_search', __ ( 'Track search', 'wp-piwik' ), __ ( 'Use Matomo\'s advanced Site Search Analytics feature.' ) . ' ' . sprintf ( __ ( 'See %sMatomo documentation%s.', 'wp-piwik' ), '<a href="http://piwik.org/docs/site-search/#track-site-search-using-the-tracking-api-advanced-users-only" target="_BLANK">', '</a>' ), $isNotTracking, $fullGeneratedTrackingGroup . ' wp-piwik-track-option-manually' );
$this->showCheckbox ( 'track_404', __ ( 'Track 404', 'wp-piwik' ), __ ( 'WP-Matomo can automatically add a 404-category to track 404-page-visits.', 'wp-piwik' ) . ' ' . sprintf ( __ ( 'See %sMatomo FAQ%s.', 'wp-piwik' ), '<a href="http://piwik.org/faq/how-to/faq_60/" target="_BLANK">', '</a>' ), $isNotTracking, $fullGeneratedTrackingGroup . ' wp-piwik-track-option-manually' );
echo '<tr class="' . $fullGeneratedTrackingGroup . ' wp-piwik-track-option-manually' . ($isNotTracking ? ' hidden' : '') . '">';
echo '<th scope="row"><label for="add_post_annotations">' . __ ( 'Add annotation on new post of type', 'wp-piwik' ) . '</label>:</th><td>';
$filter = self::$settings->getGlobalOption ( 'add_post_annotations' );
foreach ( get_post_types(array(), 'objects') as $post_type )
echo '<input type="checkbox" ' . (isset ( $filter [$post_type->name] ) && $filter [$post_type->name] ? 'checked="checked" ' : '') . 'value="1" name="wp-piwik[add_post_annotations][' . $post_type->name . ']" /> ' . $post_type->label . ' &nbsp; ';
echo '<span class="dashicons dashicons-editor-help" onclick="$j(\'#add_post_annotations-desc\').toggleClass(\'hidden\');"></span> <p class="description hidden" id="add_post_annotations-desc">' . sprintf ( __ ( 'See %sMatomo documentation%s.', 'wp-piwik' ), '<a href="http://piwik.org/docs/annotations/" target="_BLANK">', '</a>' ) . '</p></td></tr>';
$this->showCheckbox ( 'add_customvars_box', __ ( 'Show custom variables box', 'wp-piwik' ), __ ( ' Show a &quot;custom variables&quot; edit box on post edit page.', 'wp-piwik' ) . ' ' . sprintf ( __ ( 'See %sMatomo documentation%s.', 'wp-piwik' ), '<a href="http://piwik.org/docs/custom-variables/" target="_BLANK">', '</a>' ), $isNotGeneratedTracking, $fullGeneratedTrackingGroup . ' wp-piwik-track-option-manually' );
$this->showInput ( 'add_download_extensions', __ ( 'Add new file types for download tracking', 'wp-piwik' ), __ ( 'Add file extensions for download tracking, divided by a vertical bar (&#124;).', 'wp-piwik' ) . ' ' . sprintf ( __ ( 'See %sMatomo documentation%s.', 'wp-piwik' ), '<a href="https://developer.piwik.org/guides/tracking-javascript-guide#file-extensions-for-tracking-downloads" target="_BLANK">', '</a>' ), $isNotGeneratedTracking, $fullGeneratedTrackingGroup );
$this->showCheckbox ( 'disable_cookies', __ ( 'Disable cookies', 'wp-piwik' ), __ ( 'Disable all tracking cookies for a visitor.', 'wp-piwik' ), $isNotGeneratedTracking, $fullGeneratedTrackingGroup );
$this->showCheckbox ( 'limit_cookies', __ ( 'Limit cookie lifetime', 'wp-piwik' ), __ ( 'You can limit the cookie lifetime to avoid tracking your users over a longer period as necessary.', 'wp-piwik' ), $isNotGeneratedTracking, $fullGeneratedTrackingGroup, true, '$j(\'tr.wp-piwik-cookielifetime-option\').toggleClass(\'wp-piwik-hidden\');' );
$this->showInput ( 'limit_cookies_visitor', __ ( 'Visitor timeout (seconds)', 'wp-piwik' ), false, $isNotGeneratedTracking || ! self::$settings->getGlobalOption ( 'limit_cookies' ), $fullGeneratedTrackingGroup.' wp-piwik-cookielifetime-option'. (self::$settings->getGlobalOption ( 'limit_cookies' )? '': ' wp-piwik-hidden') );
$this->showInput ( 'limit_cookies_session', __ ( 'Session timeout (seconds)', 'wp-piwik' ), false, $isNotGeneratedTracking || ! self::$settings->getGlobalOption ( 'limit_cookies' ), $fullGeneratedTrackingGroup .' wp-piwik-cookielifetime-option'. (self::$settings->getGlobalOption ( 'limit_cookies' )? '': ' wp-piwik-hidden') );
$this->showInput ( 'limit_cookies_referral', __ ( 'Referral timeout (seconds)', 'wp-piwik' ), false, $isNotGeneratedTracking || ! self::$settings->getGlobalOption ( 'limit_cookies' ), $fullGeneratedTrackingGroup .' wp-piwik-cookielifetime-option'. (self::$settings->getGlobalOption ( 'limit_cookies' )? '': ' wp-piwik-hidden') );
$this->showCheckbox ( 'track_admin', __ ( 'Track admin pages', 'wp-piwik' ), __ ( 'Enable to track users on admin pages (remember to configure the tracking filter appropriately).', 'wp-piwik' ), $isNotTracking, $fullGeneratedTrackingGroup . ' wp-piwik-track-option-manually' );
echo '<tr class="' . $fullGeneratedTrackingGroup . ' wp-piwik-track-option-manually' . ($isNotTracking ? ' hidden' : '') . '">';
echo '<th scope="row"><label for="capability_stealth">' . __ ( 'Tracking filter', 'wp-piwik' ) . '</label>:</th><td>';
$filter = self::$settings->getGlobalOption ( 'capability_stealth' );
foreach ( $wp_roles->role_names as $key => $name )
echo '<input type="checkbox" ' . (isset ( $filter [$key] ) && $filter [$key] ? 'checked="checked" ' : '') . 'value="1" name="wp-piwik[capability_stealth][' . $key . ']" /> ' . $name . ' &nbsp; ';
echo '<span class="dashicons dashicons-editor-help" onclick="$j(\'#capability_stealth-desc\').toggleClass(\'hidden\');"></span> <p class="description hidden" id="capability_stealth-desc">' . __ ( 'Choose users by user role you do <strong>not</strong> want to track.', 'wp-piwik' ) . '</p></td></tr>';
$this->showCheckbox ( 'track_across', __ ( 'Track subdomains in the same website', 'wp-piwik' ), __ ( 'Adds *.-prefix to cookie domain.', 'wp-piwik' ) . ' ' . sprintf ( __ ( 'See %sMatomo documentation%s.', 'wp-piwik' ), '<a href="https://developer.piwik.org/guides/tracking-javascript-guide#tracking-subdomains-in-the-same-website" target="_BLANK">', '</a>' ), $isNotGeneratedTracking, $fullGeneratedTrackingGroup );
$this->showCheckbox ( 'track_across_alias', __ ( 'Do not count subdomains as outlink', 'wp-piwik' ), __ ( 'Adds *.-prefix to tracked domain.', 'wp-piwik' ) . ' ' . sprintf ( __ ( 'See %sMatomo documentation%s.', 'wp-piwik' ), '<a href="https://developer.piwik.org/guides/tracking-javascript-guide#outlink-tracking-exclusions" target="_BLANK">', '</a>' ), $isNotGeneratedTracking, $fullGeneratedTrackingGroup );
$this->showCheckbox ( 'track_crossdomain_linking', __ ( 'Enable cross domain linking', 'wp-piwik' ), __ ( 'When enabled, it will make sure to use the same visitor ID for the same visitor across several domains. This works only when this feature is enabled because the visitor ID is stored in a cookie and cannot be read on the other domain by default. When this feature is enabled, it will append a URL parameter "pk_vid" that contains the visitor ID when a user clicks on a URL that belongs to one of your domains. For this feature to work, you also have to configure which domains should be treated as local in your Matomo website settings. This feature requires Matomo 3.0.2.', 'wp-piwik' ), self::$settings->getGlobalOption ( 'track_mode' ) == 'proxy', 'wp-piwik-track-option wp-piwik-track-option-default wp-piwik-track-option-js wp-piwik-track-option-manually');
$this->showCheckbox ( 'track_feed', __ ( 'Track RSS feeds', 'wp-piwik' ), __ ( 'Enable to track posts in feeds via tracking pixel.', 'wp-piwik' ), $isNotTracking, $fullGeneratedTrackingGroup . ' wp-piwik-track-option-manually' );
$this->showCheckbox ( 'track_feed_addcampaign', __ ( 'Track RSS feed links as campaign', 'wp-piwik' ), __ ( 'This will add Matomo campaign parameters to the RSS feed links.' . ' ' . sprintf ( __ ( 'See %sMatomo documentation%s.', 'wp-piwik' ), '<a href="http://piwik.org/docs/tracking-campaigns/" target="_BLANK">', '</a>' ), 'wp-piwik' ), $isNotTracking, $fullGeneratedTrackingGroup . ' wp-piwik-track-option-manually', true, '$j(\'tr.wp-piwik-feed_campaign-option\').toggle(\'hidden\');' );
$this->showInput ( 'track_feed_campaign', __ ( 'RSS feed campaign', 'wp-piwik' ), __ ( 'Keyword: post name.', 'wp-piwik' ), $isNotGeneratedTracking || ! self::$settings->getGlobalOption ( 'track_feed_addcampaign' ), $fullGeneratedTrackingGroup . ' wp-piwik-feed_campaign-option' );
$this->showInput ( 'track_heartbeat', __ ( 'Enable heartbeat timer', 'wp-piwik' ), __ ( 'Enable a heartbeat timer to get more accurate visit lengths by sending periodical HTTP ping requests as long as the site is opened. Enter the time between the pings in seconds (Matomo default: 15) to enable or 0 to disable this feature. <strong>Note:</strong> This will cause a lot of additional HTTP requests on your site.', 'wp-piwik' ), $isNotGeneratedTracking, $fullGeneratedTrackingGroup );
$this->showSelect ( 'track_user_id', __ ( 'User ID Tracking', 'wp-piwik' ), array (
'disabled' => __ ( 'Disabled', 'wp-piwik' ),
'uid' => __ ( 'WP User ID', 'wp-piwik' ),
'email' => __ ( 'Email Address', 'wp-piwik' ),
'username' => __ ( 'Username', 'wp-piwik' ),
'displayname' => __ ( 'Display Name (Not Recommended!)', 'wp-piwik' )
), __ ( 'When a user is logged in to WordPress, track their &quot;User ID&quot;. You can select which field from the User\'s profile is tracked as the &quot;User ID&quot;. When enabled, Tracking based on Email Address is recommended.', 'wp-piwik' ), '', $isNotTracking, $fullGeneratedTrackingGroup );
echo $submitButton;
echo '</tbody></table><table id="expert" class="wp-piwik_menu-tab hidden"><tbody>';
$this->showText ( __ ( 'Usually, you do not need to change these settings. If you want to do so, you should know what you do or you got an expert\'s advice.', 'wp-piwik' ) );
$this->showCheckbox ( 'cache', __ ( 'Enable cache', 'wp-piwik' ), __ ( 'Cache API calls, which not contain today\'s values, for a week.', 'wp-piwik' ) );
if (function_exists('curl_init') && ini_get('allow_url_fopen'))
$this->showSelect ( 'http_connection', __ ( 'HTTP connection via', 'wp-piwik' ), array (
'curl' => __ ( 'cURL', 'wp-piwik' ),
'fopen' => __ ( 'fopen', 'wp-piwik' )
), __('Choose whether WP-Matomo should use cURL or fopen to connect to Matomo in HTTP or Cloud mode.', 'wp-piwik' ) );
$this->showSelect ( 'http_method', __ ( 'HTTP method', 'wp-piwik' ), array (
'post' => __ ( 'POST', 'wp-piwik' ),
'get' => __ ( 'GET', 'wp-piwik' )
), __('Choose whether WP-Matomo should use POST or GET in HTTP or Cloud mode.', 'wp-piwik' ) );
$this->showCheckbox ( 'disable_timelimit', __ ( 'Disable time limit', 'wp-piwik' ), __ ( 'Use set_time_limit(0) if stats page causes a time out.', 'wp-piwik' ) );
$this->showInput ( 'filter_limit', __ ( 'Filter limit', 'wp-piwik' ), __ ( 'Use filter_limit if you need to get more than 100 results per page.', 'wp-piwik' ) );
$this->showInput ( 'connection_timeout', __ ( 'Connection timeout', 'wp-piwik' ), 'Define a connection timeout for all HTTP requests done by WP-Matomo in seconds.' );
$this->showCheckbox ( 'disable_ssl_verify', __ ( 'Disable SSL peer verification', 'wp-piwik' ), '(' . __ ( 'not recommended', 'wp-piwik' ) . ')' );
$this->showCheckbox ( 'disable_ssl_verify_host', __ ( 'Disable SSL host verification', 'wp-piwik' ), '(' . __ ( 'not recommended', 'wp-piwik' ) . ')' );
$this->showSelect ( 'piwik_useragent', __ ( 'User agent', 'wp-piwik' ), array (
'php' => __ ( 'Use the PHP default user agent', 'wp-piwik' ) . (ini_get ( 'user_agent' ) ? '(' . ini_get ( 'user_agent' ) . ')' : ' (' . __ ( 'empty', 'wp-piwik' ) . ')'),
'own' => __ ( 'Define a specific user agent', 'wp-piwik' )
), 'WP-Matomo can send the default user agent defined by your PHP settings or use a specific user agent below. The user agent is send by WP-Matomo if HTTP requests are performed.', '$j(\'tr.wp-piwik-useragent-option\').toggleClass(\'hidden\');' );
$this->showInput ( 'piwik_useragent_string', __ ( 'Specific user agent', 'wp-piwik' ), 'Define a user agent description which is send by WP-Matomo if HTTP requests are performed.', self::$settings->getGlobalOption ( 'piwik_useragent' ) != 'own', 'wp-piwik-useragent-option' );
$this->showCheckbox ( 'dnsprefetch', __ ( 'Enable DNS prefetch', 'wp-piwik' ), __ ( 'Add a DNS prefetch tag.' . ' ' . sprintf ( __ ( 'See %sMatomo Blog%s.', 'wp-piwik' ), '<a target="_BLANK" href="https://piwik.org/blog/2017/04/important-performance-optimizations-load-piwik-javascript-tracker-faster/">', '</a>' ), 'wp-piwik' ) );
$this->showCheckbox ( 'track_datacfasync', __ ( 'Add data-cfasync=false', 'wp-piwik' ), __ ( 'Adds data-cfasync=false to the script tag, e.g., to ask Rocket Loader to ignore the script.' . ' ' . sprintf ( __ ( 'See %sCloudFlare Knowledge Base%s.', 'wp-piwik' ), '<a href="https://support.cloudflare.com/hc/en-us/articles/200169436-How-can-I-have-Rocket-Loader-ignore-my-script-s-in-Automatic-Mode-" target="_BLANK">', '</a>' ), 'wp-piwik' ) );
$this->showInput ( 'track_cdnurl', __ ( 'CDN URL', 'wp-piwik' ).' http://', 'Enter URL if you want to load the tracking code via CDN.' );
$this->showInput ( 'track_cdnurlssl', __ ( 'CDN URL (SSL)', 'wp-piwik' ).' https://', 'Enter URL if you want to load the tracking code via a separate SSL CDN.' );
$this->showSelect ( 'force_protocol', __ ( 'Force Matomo to use a specific protocol', 'wp-piwik' ), array (
'disabled' => __ ( 'Disabled (default)', 'wp-piwik' ),
'http' => __ ( 'http', 'wp-piwik' ),
'https' => __ ( 'https (SSL)', 'wp-piwik' )
), __ ( 'Choose if you want to explicitly force Matomo to use HTTP or HTTPS. Does not work with a CDN URL.', 'wp-piwik' ) );
$this->showSelect ( 'update_notice', __ ( 'Update notice', 'wp-piwik' ), array (
'enabled' => __ ( 'Show always if WP-Matomo is updated', 'wp-piwik' ),
'script' => __ ( 'Show only if WP-Matomo is updated and settings were changed', 'wp-piwik' ),
'disabled' => __ ( 'Disabled', 'wp-piwik' )
), __ ( 'Choose if you want to get an update notice if WP-Matomo is updated.', 'wp-piwik' ) );
$this->showInput ( 'set_download_extensions', __ ( 'Define all file types for download tracking', 'wp-piwik' ), __ ( 'Replace Matomo\'s default file extensions for download tracking, divided by a vertical bar (&#124;). Leave blank to keep Matomo\'s default settings.', 'wp-piwik' ) . ' ' . sprintf ( __ ( 'See %sMatomo documentation%s.', 'wp-piwik' ), '<a href="https://developer.piwik.org/guides/tracking-javascript-guide#file-extensions-for-tracking-downloads" target="_BLANK">', '</a>' ) );
$this->showInput ( 'set_download_classes', __ ( 'Set classes to be treated as downloads', 'wp-piwik' ), __ ( 'Set classes to be treated as downloads (in addition to piwik_download), divided by a vertical bar (&#124;). Leave blank to keep Matomo\'s default settings.', 'wp-piwik' ) . ' ' . sprintf ( __ ( 'See %sMatomo JavaScript Tracking Client reference%s.', 'wp-piwik' ), '<a href="https://developer.piwik.org/api-reference/tracking-javascript" target="_BLANK">', '</a>' ) );
$this->showInput ( 'set_link_classes', __ ( 'Set classes to be treated as outlinks', 'wp-piwik' ), __ ( 'Set classes to be treated as outlinks (in addition to piwik_link), divided by a vertical bar (&#124;). Leave blank to keep Matomo\'s default settings.', 'wp-piwik' ) . ' ' . sprintf ( __ ( 'See %sMatomo JavaScript Tracking Client reference%s.', 'wp-piwik' ), '<a href="https://developer.piwik.org/api-reference/tracking-javascript" target="_BLANK">', '</a>' ) );
echo $submitButton;
?>
</tbody>
</table>
<table id="support" class="wp-piwik_menu-tab hidden">
<tbody>
<tr><td colspan="2"><?php
echo $this->showSupport();
?></td></tr>
</tbody>
</table>
<table id="credits" class="wp-piwik_menu-tab hidden">
<tbody>
<tr><td colspan="2"><?php
echo $this->showCredits();
?></td></tr>
</tbody>
</table>
<input type="hidden" name="wp-piwik[proxy_url]"
value="<?php echo self::$settings->getGlobalOption('proxy_url'); ?>" />
</form>
</div>
<?php
}
/**
* Show an option's description
*
* @param string $id option id
* @param string $description option description
* @param boolean $hideDescription set to false to show description initially (default: true)
* @return string full description HTML
*/
private function getDescription($id, $description, $hideDescription = true) {
return sprintf ( '<span class="dashicons dashicons-editor-help" onclick="$j(\'#%s-desc\').toggleClass(\'hidden\');"></span> <p class="description' . ($hideDescription ? ' hidden' : '') . '" id="%1$s-desc">%s</p>', $id, $description );
}
/**
* Show a checkbox option
*
* @param string $id option id
* @param string $name descriptive option name
* @param string $description option description
* @param boolean $isHidden set to true to initially hide the option (default: false)
* @param string $groupName define a class name to access a group of option rows by javascript (default: empty)
* @param boolean $hideDescription $hideDescription set to false to show description initially (default: true)
* @param string $onChange javascript for onchange event (default: empty)
*/
private function showCheckbox($id, $name, $description, $isHidden = false, $groupName = '', $hideDescription = true, $onChange = '') {
printf ( '<tr class="' . $groupName . ($isHidden ? ' hidden' : '') . '"><th scope="row"><label for="%2$s">%s</label>:</th><td><input type="checkbox" value="1"' . (self::$settings->getGlobalOption ( $id ) ? ' checked="checked"' : '') . ' onchange="$j(\'#%s\').val(this.checked?1:0);%s" /><input id="%2$s" type="hidden" name="wp-piwik[%2$s]" value="' . ( int ) self::$settings->getGlobalOption ( $id ) . '" /> %s</td></tr>', $name, $id, $onChange, $this->getDescription ( $id, $description, $hideDescription ) );
}
/**
* Show a textarea option
*
* @param string $id option id
* @param string $name descriptive option name
* @param int $rows number of rows to show
* @param string $description option description
* @param boolean $isHidden set to true to initially hide the option (default: false)
* @param string $groupName define a class name to access a group of option rows by javascript (default: empty)
* @param boolean $hideDescription $hideDescription set to false to show description initially (default: true)
* @param string $onChange javascript for onchange event (default: empty)
* @param boolean $isReadonly set textarea to read only (default: false)
* @param boolean $global set to false if the textarea shows a site-specific option (default: true)
*/
private function showTextarea($id, $name, $rows, $description, $isHidden, $groupName, $hideDescription = true, $onChange = '', $isReadonly = false, $global = true) {
printf (
'<tr class="' . $groupName . ($isHidden ? ' hidden' : '') . '"><th scope="row"><label for="%2$s">%s</label>:</th><td><textarea cols="80" rows="' . $rows . '" id="%s" name="wp-piwik[%2$s]" onchange="%s"' . ($isReadonly ? ' readonly="readonly"' : '') . '>%s</textarea> %s</td></tr>', $name, $id, $onChange, ($global ? self::$settings->getGlobalOption ( $id ) : self::$settings->getOption ( $id )), $this->getDescription ( $id, $description, $hideDescription ) );
}
/**
* Show a simple text
*
* @param string $text Text to show
*/
private function showText($text) {
printf ( '<tr><td colspan="2"><p>%s</p></td></tr>', $text );
}
/**
* Show an input option
*
* @param string $id option id
* @param string $name descriptive option name
* @param string $description option description
* @param boolean $isHidden set to true to initially hide the option (default: false)
* @param string $groupName define a class name to access a group of option rows by javascript (default: empty)
* @param string $rowName define a class name to access the specific option row by javascript (default: empty)
* @param boolean $hideDescription $hideDescription set to false to show description initially (default: true)
* @param boolean $wide Create a wide box (default: false)
*/
private function showInput($id, $name, $description, $isHidden = false, $groupName = '', $rowName = false, $hideDescription = true, $wide = false) {
printf ( '<tr class="%s%s"%s><th scope="row"><label for="%5$s">%s:</label></th><td><input '.($wide?'class="wp-piwik-wide" ':'').'name="wp-piwik[%s]" id="%5$s" value="%s" /> %s</td></tr>', $isHidden ? 'hidden ' : '', $groupName ? $groupName : '', $rowName ? ' id="' . $groupName . '-' . $rowName . '"' : '', $name, $id, htmlentities(self::$settings->getGlobalOption( $id ), ENT_QUOTES, 'UTF-8', false), !empty($description) ? $this->getDescription ( $id, $description, $hideDescription ) : '' );
}
/**
* Show a select box option
*
* @param string $id option id
* @param string $name descriptive option name
* @param array $options list of options to show array[](option id => descriptive name)
* @param string $description option description
* @param string $onChange javascript for onchange event (default: empty)
* @param boolean $isHidden set to true to initially hide the option (default: false)
* @param string $groupName define a class name to access a group of option rows by javascript (default: empty)
* @param boolean $hideDescription $hideDescription set to false to show description initially (default: true)
* @param boolean $global set to false if the textarea shows a site-specific option (default: true)
*/
private function showSelect($id, $name, $options = array(), $description = '', $onChange = '', $isHidden = false, $groupName = '', $hideDescription = true, $global = true) {
$optionList = '';
$default = $global ? self::$settings->getGlobalOption ( $id ) : self::$settings->getOption ( $id );
if (is_array ( $options ))
foreach ( $options as $key => $value )
$optionList .= sprintf ( '<option value="%s"' . ($key == $default ? ' selected="selected"' : '') . '>%s</option>', $key, $value );
printf ( '<tr class="' . $groupName . ($isHidden ? ' hidden' : '') . '"><th scope="row"><label for="%2$s">%s:</label></th><td><select name="wp-piwik[%s]" id="%2$s" onchange="%s">%s</select> %s</td></tr>', $name, $id, $onChange, $optionList, $this->getDescription ( $id, $description, $hideDescription ) );
}
/**
* Show an info box
*
* @param string $type box style (e.g., updated, error)
* @param string $icon box icon, see https://developer.wordpress.org/resource/dashicons/
* @param string $content box message
*/
private function showBox($type, $icon, $content) {
printf ( '<tr><td colspan="2"><div class="%s"><p><span class="dashicons dashicons-%s"></span> %s</p></div></td></tr>', $type, $icon, $content );
}
/**
* Show headline
* @param int $order headline order (h?-tag), set to 0 to avoid headline-tagging
* @param string $icon headline icon, see https://developer.wordpress.org/resource/dashicons/
* @param string $headline headline text
* @param string $addPluginName set to true to add the plugin name to the headline (default: false)
*/
private function showHeadline($order, $icon, $headline, $addPluginName = false) {
echo $this->getHeadline ( $order, $icon, $headline, $addPluginName = false );
}
/**
* Get headline HTML
*
* @param int $order headline order (h?-tag), set to 0 to avoid headline-tagging
* @param string $icon headline icon, see https://developer.wordpress.org/resource/dashicons/
* @param string $headline headline text
* @param string $addPluginName set to true to add the plugin name to the headline (default: false)
*/
private function getHeadline($order, $icon, $headline, $addPluginName = false) {
echo ($order > 0 ? "<h$order>" : '') . sprintf ( '<span class="dashicons dashicons-%s"></span> %s%s', $icon, ($addPluginName ? self::$settings->getGlobalOption ( 'plugin_display_name' ) . ' ' : ''), __ ( $headline, 'wp-piwik' ) ) . ($order > 0 ? "</h$order>" : '');
}
/**
* Show donation info
*/
private function showDonation() {
?>
<div class="wp-piwik-donate">
<p>
<strong><?php _e('Donate','wp-piwik'); ?></strong>
</p>
<p>
<?php _e('If you like WP-Matomo, you can support its development by a donation:', 'wp-piwik'); ?>
</p>
<div>
<script id='fb0ahsp'>(function(i){var f,s=document.getElementById(i);f=document.createElement('iframe');f.src='//button.flattr.com/view/?fid=mkdp7z&url=https%3A%2F%2Fwww.braekling.de%2Fwp-piwik-wpmu-piwik-wordpress';f.title='Flattr';f.height=62;f.width=55;f.style.borderWidth=0;s.parentNode.insertBefore(f,s);})('fb0ahsp');</script>
</div>
<div>
Paypal
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_s-xclick" />
<input type="hidden" name="hosted_button_id" value="6046779" />
<input type="image" src="https://www.paypal.com/en_GB/i/btn/btn_donateCC_LG.gif" name="submit" alt="PayPal - The safer, easier way to pay online." />
<img alt="" border="0" src="https://www.paypal.com/de_DE/i/scr/pixel.gif" width="1" height="1" />
</form>
</div>
<div>
<a href="bitcoin:32FMBngRne9wQ7XPFP2CfR25tjp3oa4roN">Bitcoin<br />
<img style="border:none;" src="<?php echo self::$wpPiwik->getPluginURL(); ?>bitcoin.png" width="100" height="100" alt="Bitcoin Address" title="32FMBngRne9wQ7XPFP2CfR25tjp3oa4roN" /></a>
</div>
<div>
<a href="http://www.amazon.de/gp/registry/wishlist/111VUJT4HP1RA?reveal=unpurchased&amp;filter=all&amp;sort=priority&amp;layout=standard&amp;x=12&amp;y=14"><?php _e('My Amazon.de wishlist', 'wp-piwik'); ?></a>
</div>
<div>
<?php _e('Please don\'t forget to vote the compatibility at the','wp-piwik'); ?> <a target="_BLANK" href="http://wordpress.org/extend/plugins/wp-piwik/">WordPress.org Plugin Directory</a>.
</div>
</div><?php
}
/**
* Register admin scripts
*
* @see \WP_Piwik\Admin::printAdminScripts()
*/
public function printAdminScripts() {
wp_enqueue_script ( 'jquery' );
}
/**
* Extend admin header
*
* @see \WP_Piwik\Admin::extendAdminHeader()
*/
public function extendAdminHeader() {
echo '<script type="text/javascript">var $j = jQuery.noConflict();</script>';
}
/**
* Show credits
*/
public function showCredits() {
?>
<p><strong><?php _e('Thank you very much for your donation', 'wp-piwik'); ?>:</strong> Marco L., Rolf W., Tobias U., Lars K., Donna F., Kevin D., Ramos S., Thomas M., John C., Andreas G., Ben M., Myra R. I., Carlos U. R.-S., Oleg I., M. N., Daniel K., James L., Jochen K., Cyril P., Thomas K., Patrik K., Zach, Sebastian W., Peakkom, Patrik K., Kati K., Helmut O., Valerie S., Jochen D., Atlas R., Harald W., Jan M., Addy K., Hans-Georg E.-B., Yvonne K., Andrew D., Nicolas, J., Andre M., Steve J., Jakub P., ditho.berlin, Robert R., Simon B., Grzegorz O., Bjarne O., Georg H., Tino S., Carola H., Bo K. C., Timothy T., Heinz L., <?php _e('the Matomo team itself','wp-piwik');?><?php _e(', and all people flattering this','wp-piwik'); ?>!</p>
<p><?php _e('Graphs powered by <a href="http://www.jqplot.com/" target="_BLANK">jqPlot</a> (License: GPL 2.0 and MIT) and <a href="http://omnipotent.net/jquery.sparkline/" target="_BLANK">jQuery Sparklines</a> (License: New BSD License).','wp-piwik'); ?></p>
<p><?php _e('Thank you very much','wp-piwik'); ?>, <?php _e('Transifex and WordPress translation community for your translation work.','wp-piwik'); ?>!</p>
<p><?php _e('Thank you very much, all users who send me mails containing criticism, commendation, feature requests and bug reports! You help me to make WP-Matomo much better.','wp-piwik'); ?></p>
<p><?php _e('Thank <strong>you</strong> for using my plugin. It is the best commendation if my piece of code is really used!','wp-piwik'); ?></p>
<?php
}
/**
* Show support information
*/
public function showSupport() {
?><ul>
<li><?php _e('The best place to get help:', 'wp-piwik'); ?> <a href="https://wordpress.org/support/plugin/wp-piwik" target="_BLANK"><?php _e('WP-Matomo support forum','wp-piwik'); ?></a></li>
<li><?php _e('Please don\'t forget to vote the compatibility at the','wp-piwik'); ?> <a href="http://wordpress.org/extend/plugins/wp-piwik/" target="_BLANK">WordPress.org Plugin Directory</a>.</li>
</ul>
<h3><?php _e('Debugging', 'wp-piwik'); ?></h3>
<p><?php _e('Either allow_url_fopen has to be enabled <em>or</em> cURL has to be available:', 'wp-piwik'); ?></p>
<ol>
<li><?php
_e('cURL is','wp-piwik');
echo ' <strong>'.(function_exists('curl_init')?'':__('not','wp-piwik')).' ';
_e('available','wp-piwik');
?></strong>.</li>
<li><?php
_e('allow_url_fopen is','wp-piwik');
echo ' <strong>'.(ini_get('allow_url_fopen')?'':__('not','wp-piwik')).' ';
_e('enabled','wp-piwik');
?></strong>.</li>
<li><strong><?php echo (((function_exists('curl_init') && ini_get('allow_url_fopen') && self::$settings->getGlobalOption('http_connection') == 'curl') || (function_exists('curl_init') && !ini_get('allow_url_fopen')))?__('cURL', 'wp-piwik'):__('fopen', 'wp-piwik')).' ('.(self::$settings->getGlobalOption('http_method')=='post'?__('POST','wp-piwik'):__('GET','wp-piwik')).')</strong> '.__('is used.', 'wp-piwik'); ?></li>
<?php if (self::$settings->getGlobalOption('piwik_mode') == 'php') { ?><li><?php
_e('Determined Matomo base URL is', 'wp-piwik');
echo ' <strong>'.(self::$settings->getGlobalOption('proxy_url')).'</strong>';
?></li><?php } ?>
</ol>
<p><?php _e('Tools', 'wp-piwik'); ?>:</p>
<ol>
<li><a href="<?php echo admin_url( (self::$settings->checkNetworkActivation () ? 'network/settings' : 'options-general').'.php?page='.$_GET['page'].'&testscript=1' ); ?>"><?php _e('Run testscript', 'wp-piwik'); ?></a></li>
<li><a href="<?php echo admin_url( (self::$settings->checkNetworkActivation () ? 'network/settings' : 'options-general').'.php?page='.$_GET['page'].'&sitebrowser=1' ); ?>"><?php _e('Sitebrowser', 'wp-piwik'); ?></a></li>
<li><a href="<?php echo admin_url( (self::$settings->checkNetworkActivation () ? 'network/settings' : 'options-general').'.php?page='.$_GET['page'].'&clear=1' ); ?>"><?php _e('Clear cache', 'wp-piwik'); ?></a></li>
<li><a onclick="return confirm('<?php _e('Are you sure you want to clear all settings?', 'wp-piwik'); ?>')" href="<?php echo admin_url( (self::$settings->checkNetworkActivation () ? 'network/settings' : 'options-general').'.php?page='.$_GET['page'].'&clear=2' ); ?>"><?php _e('Reset WP-Matomo', 'wp-piwik'); ?></a></li>
</ol>
<h3><?php _e('Latest support threads on WordPress.org', 'wp-piwik'); ?></h3><?php
$supportThreads = $this->readRSSFeed('http://wordpress.org/support/rss/plugin/wp-piwik');
if (!empty($supportThreads)) {
echo '<ol>';
foreach ($supportThreads as $supportThread)
echo '<li><a href="'.$supportThread['url'].'">'.$supportThread['title'].'</a></li>';
echo '</ol>';
}
}
/**
* Read RSS feed
*
* @param string $feed
* feed URL
* @param int $cnt
* item limit
* @return array feed items array[](title, url)
*
*/
private function readRSSFeed($feed, $cnt = 5) {
$result = array ();
if (function_exists ( 'simplexml_load_file' ) && ! empty ( $feed )) {
$xml = @simplexml_load_file ( $feed );
if (! $xml || ! isset ( $xml->channel [0]->item ))
return array (
array (
'title' => 'Can\'t read RSS feed.',
'url' => $xml
)
);
foreach ( $xml->channel [0]->item as $item ) {
if ($cnt -- == 0)
break;
$result [] = array (
'title' => $item->title [0],
'url' => $item->link [0]
);
}
}
return $result;
}
/**
* Clear cache and reset settings
*
* @param boolean $clearSettings set to true to reset settings (default: false)
*/
private function clear($clearSettings = false) {
if ($clearSettings) {
self::$settings->resetSettings();
$this->showBox ( 'updated', 'yes', __ ( 'Settings cleared (except connection settings).' ) );
}
global $wpdb;
if (self::$settings->checkNetworkActivation()) {
$aryBlogs = \WP_Piwik\Settings::getBlogList();
if (is_array($aryBlogs))
foreach ($aryBlogs as $aryBlog) {
switch_to_blog($aryBlog['blog_id']);
$wpdb->query("DELETE FROM $wpdb->options WHERE option_name LIKE '_transient_wp-piwik_%'");
$wpdb->query("DELETE FROM $wpdb->options WHERE option_name LIKE '_transient_timeout_wp-piwik_%'");
restore_current_blog();
}
} else {
$wpdb->query("DELETE FROM $wpdb->options WHERE option_name LIKE '_transient_wp-piwik_%'");
$wpdb->query("DELETE FROM $wpdb->options WHERE option_name LIKE '_transient_timeout_wp-piwik_%'");
}
$this->showBox ( 'updated', 'yes', __ ( 'Cache cleared.' ) );
}
/**
* Execute test script and display results
*/
private function runTestscript() { ?>
<div class="wp-piwik-debug">
<h2>Testscript Result</h2>
<?php
if (self::$wpPiwik->isConfigured()) {
if (isset($_GET['testscript_id']) && $_GET['testscript_id'])
switch_to_blog((int) $_GET['testscript_id']);
?>
<textarea cols="80" rows="10"><?php
echo '`WP-Matomo '.self::$wpPiwik->getPluginVersion()."\nMode: ".self::$settings->getGlobalOption('piwik_mode')."\n\n";
?>Test 1/3: global.getPiwikVersion<?php
$GLOBALS ['wp-piwik_debug'] = true;
$id = \WP_Piwik\Request::register ( 'API.getPiwikVersion', array() );
echo "\n\n"; var_dump( self::$wpPiwik->request( $id ) ); echo "\n";
var_dump( self::$wpPiwik->request( $id, true ) ); echo "\n";
$GLOBALS ['wp-piwik_debug'] = false;
?>Test 2/3: SitesManager.getSitesWithAtLeastViewAccess<?php
$GLOBALS ['wp-piwik_debug'] = true;
$id = \WP_Piwik\Request::register ( 'SitesManager.getSitesWithAtLeastViewAccess', array() );
echo "\n\n"; var_dump( self::$wpPiwik->request( $id ) ); echo "\n";
var_dump( self::$wpPiwik->request( $id, true ) ); echo "\n";
$GLOBALS ['wp-piwik_debug'] = false;
?>Test 3/3: SitesManager.getSitesIdFromSiteUrl<?php
$GLOBALS ['wp-piwik_debug'] = true;
$id = \WP_Piwik\Request::register ( 'SitesManager.getSitesIdFromSiteUrl', array (
'url' => get_bloginfo ( 'url' )
) );
echo "\n\n"; var_dump( self::$wpPiwik->request( $id ) ); echo "\n";
var_dump( self::$wpPiwik->request( $id, true ) ); echo "\n";
echo "\n\n"; var_dump( self::$settings->getDebugData() ); echo "`";
$GLOBALS ['wp-piwik_debug'] = false;
?></textarea>
<?php
if (isset($_GET['testscript_id']) && $_GET['testscript_id'])
restore_current_blog();
} else echo '<p>Please configure WP-Matomo first.</p>';
?>
</div>
<?php }
}

View File

@ -1,112 +0,0 @@
<?php
namespace WP_Piwik\Admin;
if (! class_exists ( 'WP_List_Table' ))
require_once (ABSPATH . 'wp-admin/includes/class-wp-list-table.php');
class Sitebrowser extends \WP_List_Table {
private $data = array (), $wpPiwik;
public function __construct($wpPiwik) {
$this->wpPiwik = $wpPiwik;
if( isset($_POST['s']) ){
$cnt = $this->prepare_items ($_POST['s']);
} else {
$cnt = $this->prepare_items ();
}
global $status, $page;
$this->showSearchForm();
parent::__construct ( array (
'singular' => __ ( 'site', 'wp-piwik' ),
'plural' => __ ( 'sites', 'wp-piwik' ),
'ajax' => false
) );
if ($cnt > 0)
$this->display ();
else
echo '<p>' . __ ( 'No site configured yet.', 'wp-piwik' ) . '</p>';
}
public function get_columns() {
$columns = array (
'id' => __ ( 'Blog ID', 'wp-piwik' ),
'name' => __ ( 'Title', 'wp-piwik' ),
'siteurl' => __ ( 'URL', 'wp-piwik' ),
'piwikid' => __ ( 'Site ID (Piwik)', 'wp-piwik' )
);
return $columns;
}
public function prepare_items($search = '') {
$current_page = $this->get_pagenum ();
$per_page = 10;
global $blog_id;
global $wpdb;
global $pagenow;
if (is_plugin_active_for_network ( 'wp-piwik/wp-piwik.php' )) {
$total_items = $wpdb->get_var ( $wpdb->prepare('SELECT COUNT(*) FROM ' . $wpdb->blogs . ' WHERE CONCAT(domain, path) LIKE "%%%s%%" AND spam = 0 AND deleted = 0', $search));
$blogs = \WP_Piwik\Settings::getBlogList($per_page, $current_page, $search);
foreach ( $blogs as $blog ) {
$blogDetails = get_blog_details ( $blog['blog_id'], true );
$this->data [] = array (
'name' => $blogDetails->blogname,
'id' => $blogDetails->blog_id,
'siteurl' => $blogDetails->siteurl,
'piwikid' => $this->wpPiwik->getPiwikSiteId ( $blogDetails->blog_id )
);
}
} else {
$blogDetails = get_bloginfo ();
$this->data [] = array (
'name' => get_bloginfo ( 'name' ),
'id' => '-',
'siteurl' => get_bloginfo ( 'url' ),
'piwikid' => $this->wpPiwik->getPiwikSiteId ()
);
$total_items = 1;
}
$columns = $this->get_columns ();
$hidden = array ();
$sortable = array ();
$this->_column_headers = array (
$columns,
$hidden,
$sortable
);
$this->set_pagination_args ( array (
'total_items' => $total_items,
'per_page' => $per_page
) );
foreach ( $this->data as $key => $dataset ) {
if (empty ( $dataset ['piwikid'] ) || $dataset ['piwikid'] == 'n/a')
$this->data [$key] ['piwikid'] = __ ( 'Site not created yet.', 'wp-piwik' );
if ($this->wpPiwik->isNetworkMode ())
$this->data [$key] ['name'] = '<a href="index.php?page=wp-piwik_stats&wpmu_show_stats=' . $dataset ['id'] . '">' . $dataset ['name'] . '</a>';
}
$this->items = $this->data;
return count ( $this->items );
}
public function column_default($item, $column_name) {
switch ($column_name) {
case 'id' :
case 'name' :
case 'siteurl' :
case 'piwikid' :
return $item [$column_name];
default :
return print_r ( $item, true );
}
}
private function showSearchForm() {
?>
<form method="post">
<input type="hidden" name="page" value="<?php echo filter_var($_REQUEST['page'], FILTER_SANITIZE_STRING) ?>" />
<?php $this->search_box('Search domain and path', 'wpPiwikSiteSearch'); ?>
</form>
<?php
}
}

View File

@ -1,54 +0,0 @@
<?php
namespace WP_Piwik\Admin;
class Statistics extends \WP_Piwik\Admin {
public function show() {
global $screen_layout_columns;
if (empty($screen_layout_columns)) $screen_layout_columns = 2;
if (self::$settings->getGlobalOption('disable_timelimit')) set_time_limit(0);
echo '<div id="wp-piwik-stats-general" class="wrap">';
echo '<h2>'.(self::$settings->getGlobalOption('plugin_display_name') == 'WP-Piwik'?'Piwik '.__('Statistics', 'wp-piwik'):self::$settings->getGlobalOption('plugin_display_name')).'</h2>';
if (self::$settings->checkNetworkActivation() && function_exists('is_super_admin') && is_super_admin()) {
if (isset($_GET['wpmu_show_stats'])) {
switch_to_blog((int) $_GET['wpmu_show_stats']);
} elseif ((isset($_GET['overview']) && $_GET['overview']) || (function_exists('is_network_admin') && is_network_admin())) {
new \WP_Piwik\Admin\Sitebrowser(self::$wpPiwik);
return;
}
echo '<p>'.__('Currently shown stats:').' <a href="'.get_bloginfo('url').'">'.get_bloginfo('name').'</a>.'.' <a href="?page=wp-piwik_stats&overview=1">Show site overview</a>.</p>';
echo '</form>'."\n";
}
echo '<form action="admin-post.php" method="post"><input type="hidden" name="action" value="save_wp-piwik_stats_general" /><div id="dashboard-widgets" class="metabox-holder columns-'.$screen_layout_columns.(2 <= $screen_layout_columns?' has-right-sidebar':'').'">';
wp_nonce_field('wp-piwik_stats-general');
wp_nonce_field('closedpostboxes', 'closedpostboxesnonce', false);
wp_nonce_field('meta-box-order', 'meta-box-order-nonce', false);
$columns = array('normal', 'side', 'column3');
for ($i = 0; $i < 3; $i++) {
echo '<div id="postbox-container-'.($i+1).'" class="postbox-container">';
do_meta_boxes(self::$wpPiwik->statsPageId, $columns[$i], null);
echo '</div>';
}
echo '</div></form></div>';
echo '<script type="text/javascript">//<![CDATA['."\n";
echo 'jQuery(document).ready(function($) {$(".if-js-closed").removeClass("if-js-closed").addClass("closed"); postboxes.add_postbox_toggles("'.self::$wpPiwik->statsPageId.'");});'."\n";
echo '//]]></script>'."\n";
if (self::$settings->checkNetworkActivation() && function_exists('is_super_admin') && is_super_admin()) {
restore_current_blog();
}
}
public function printAdminScripts() {
wp_enqueue_script('wp-piwik', self::$wpPiwik->getPluginURL().'js/wp-piwik.js', array(), self::$wpPiwik->getPluginVersion(), true);
wp_enqueue_script('wp-piwik-jqplot', self::$wpPiwik->getPluginURL().'js/jqplot/wp-piwik.jqplot.js',array('jquery'), self::$wpPiwik->getPluginVersion());
}
public function extendAdminHeader() {
echo '<!--[if IE]><script language="javascript" type="text/javascript" src="'.(self::$wpPiwik->getPluginURL()).'js/jqplot/excanvas.min.js"></script><![endif]-->';
echo '<link rel="stylesheet" href="'.(self::$wpPiwik->getPluginURL()).'js/jqplot/jquery.jqplot.min.css" type="text/css"/>';
echo '<script type="text/javascript">var $j = jQuery.noConflict();</script>';
}
}

View File

@ -1,47 +0,0 @@
<?php
namespace WP_Piwik;
abstract class Logger {
private $loggerName = 'unnamed';
private $loggerContent = array();
private $startMicrotime = null;
abstract function loggerOutput($loggerTime, $loggerMessage);
public function __construct($loggerName) {
$this->setName($loggerName);
$this->setStartMicrotime(microtime(true));
$this->log('Logging started -------------------------------');
}
public function __destruct() {
$this->log('Logging finished ------------------------------');
}
public function log($loggerMessage) {
$this->loggerOutput($this->getElapsedMicrotime(), $loggerMessage);
}
private function setName($loggerName) {
$this->loggerName = $loggerName;
}
public function getName() {
return $this->loggerName;
}
private function setStartMicrotime($startMicrotime) {
$this->startMicrotime = $startMicrotime;
}
public function getStartMicrotime() {
return $this->startMicrotime;
}
public function getElapsedMicrotime() {
return microtime(true) - $this->getStartMicrotime();
}
}

View File

@ -1,9 +0,0 @@
<?php
namespace WP_Piwik\Logger;
class Dummy extends \WP_Piwik\Logger {
public function loggerOutput($loggerTime, $loggerMessage) {}
}

View File

@ -1,48 +0,0 @@
<?php
namespace WP_Piwik\Logger;
class File extends \WP_Piwik\Logger {
private $loggerFile = null;
private function encodeFilename($fileName) {
$fileName = str_replace (' ', '_', $fileName);
preg_replace('/[^0-9^a-z^_^.]/', '', $fileName);
return $fileName;
}
private function setFilename() {
$this->loggerFile = WP_PIWIK_PATH.'logs'.DIRECTORY_SEPARATOR.
date('Ymd').'_'.$this->encodeFilename($this->getName()).'.log';
}
private function getFilename() {
return $this->loggerFile;
}
private function openFile() {
if (!$this->loggerFile)
$this->setFilename();
return fopen($this->getFilename(), 'a');
}
private function closeFile($fileHandle) {
fclose($fileHandle);
}
private function writeFile($fileHandle, $fileContent) {
fwrite($fileHandle, $fileContent."\n");
}
private function formatMicrotime($loggerTime) {
return sprintf('[%6s sec]',number_format($loggerTime,3));
}
public function loggerOutput($loggerTime, $loggerMessage) {
if ($fileHandle = $this->openFile()) {
$this->writeFile($fileHandle, $this->formatMicrotime($loggerTime).' '.$loggerMessage);
$this->closeFile($fileHandle);
}
}
}

View File

@ -1,27 +0,0 @@
<?php
namespace WP_Piwik\Logger;
class Screen extends \WP_Piwik\Logger {
private $logs = array();
private function formatMicrotime($loggerTime) {
return sprintf('[%6s sec]',number_format($loggerTime,3));
}
public function __construct($loggerName) {
add_action(is_admin()?'admin_footer':'wp_footer', array($this, 'echoResults'));
parent::__construct($loggerName);
}
public function loggerOutput($loggerTime, $loggerMessage) {
$this->logs[] = $this->formatMicrotime($loggerTime).' '.$loggerMessage;
}
public function echoResults() {
echo '<pre>';
print_r($this->logs);
echo '</pre>';
}
}

View File

@ -1,95 +0,0 @@
<?php
namespace WP_Piwik;
abstract class Request {
protected static $wpPiwik, $settings, $debug, $lastError = '', $requests = array(), $results = array(), $isCacheable = array(), $piwikVersion;
public function __construct($wpPiwik, $settings) {
self::$wpPiwik = $wpPiwik;
self::$settings = $settings;
self::register('API.getPiwikVersion', array());
}
public function reset() {
self::$debug = null;
self::$requests = array();
self::$results = array();
self::$isCacheable = array();
self::$piwikVersion = null;
}
public static function register($method, $parameter) {
if ($method == 'API.getPiwikVersion')
$id = 'global.getPiwikVersion';
else
$id = 'method='.$method.self::parameterToString($parameter);
if (
in_array( $method, array( 'API.getPiwikVersion', 'SitesManager.getJavascriptTag', 'SitesManager.getSitesWithAtLeastViewAccess', 'SitesManager.getSitesIdFromSiteUrl', 'SitesManager.addSite', 'SitesManager.updateSite', 'SitesManager.getSitesWithAtLeastViewAccess' ) ) ||
!isset( $parameter['date'] ) ||
!isset( $parameter['period'] ) ||
substr($parameter['date'], 0, 4) == 'last' ||
$parameter['date'] == 'today' ||
( $parameter['period'] == 'day' && $parameter['date'] == date('Ymd') ) ||
( $parameter['period'] == 'month' && $parameter['date'] == date('Ym') ) ||
( $parameter['period'] == 'week' && $parameter['date'] == date( 'Ymd', strtotime( "last Monday" ) ) )
) self::$isCacheable[$id] = false;
else self::$isCacheable[$id] = $method.'-'.serialize($parameter);
if (!isset(self::$requests[$id]))
self::$requests[$id] = array('method' => $method, 'parameter' => $parameter);
return $id;
}
private static function parameterToString($parameter) {
$return = '';
if (is_array($parameter))
foreach ($parameter as $key => $value)
$return .= '&'.$key.'='.$value;
return $return;
}
public function perform($id) {
if ( self::$settings->getGlobalOption('cache') && false !== ( $cached = get_transient( 'wp-piwik_c_'.md5(self::$isCacheable[$id] ) ) ) ) {
if (!empty ( $cached ) && !(! empty ( $cached['result'] ) && $cached['result'] == 'error') ) {
self::$wpPiwik->log("Deliver cached data: ".$id);
return $cached;
}
}
self::$wpPiwik->log("Perform request: ".$id);
if (!isset(self::$requests[$id]))
return array('result' => 'error', 'message' => 'Request '.$id.' was not registered.');
elseif (!isset(self::$results[$id])) {
$this->request($id);
}
if ( isset ( self::$results[$id] ) ) {
if ( self::$settings->getGlobalOption('cache') && self::$isCacheable[$id] ) {
set_transient( 'wp-piwik_c_'.md5(self::$isCacheable[$id]) , self::$results[$id], WEEK_IN_SECONDS );
}
return self::$results[$id];
} else return false;
}
public function getDebug($id) {
return isset( self::$debug[$id] )? self::$debug[$id] : false;
}
protected function buildURL($config, $urlDecode = false) {
$url = 'method='.($config['method']).'&idSite='.self::$settings->getOption('site_id');
foreach ($config['parameter'] as $key => $value)
$url .= '&'.$key.'='.($urlDecode?urldecode($value):$value);
return $url;
}
protected function unserialize($str) {
self::$wpPiwik->log("Result string: ".$str);
return ($str == json_decode(false, true) || @json_decode($str, true) !== false)?json_decode($str, true):array();
}
public static function getLastError() {
return self::$lastError;
}
abstract protected function request($id);
}

View File

@ -1,55 +0,0 @@
<?php
namespace WP_Piwik\Request;
class Php extends \WP_Piwik\Request {
private static $piwikEnvironment = false;
protected function request($id) {
$count = 0;
$url = self::$settings->getGlobalOption('piwik_url');
foreach (self::$requests as $requestID => $config) {
if (!isset(self::$results[$requestID])) {
if (self::$settings->getGlobalOption('filter_limit') != "" && self::$settings->getGlobalOption('filter_limit') == (int) self::$settings->getGlobalOption('filter_limit'))
$config['parameter']['filter_limit'] = self::$settings->getGlobalOption('filter_limit');
$params = 'module=API&format=json&'.$this->buildURL($config, true);
$map[$count] = $requestID;
$result = $this->call($id, $url, $params);
self::$results[$map[$count]] = $result;
$count++;
}
}
}
private function call($id, $url, $params) {
if (!defined('PIWIK_INCLUDE_PATH'))
return false;
if (PIWIK_INCLUDE_PATH === FALSE)
return array('result' => 'error', 'message' => __('Could not resolve','wp-piwik').' &quot;'.htmlentities(self::$settings->getGlobalOption('piwik_path')).'&quot;: '.__('realpath() returns false','wp-piwik').'.');
if (file_exists(PIWIK_INCLUDE_PATH . "/index.php"))
require_once PIWIK_INCLUDE_PATH . "/index.php";
if (file_exists(PIWIK_INCLUDE_PATH . "/core/API/Request.php"))
require_once PIWIK_INCLUDE_PATH . "/core/API/Request.php";
if (class_exists('\Piwik\Application\Environment') && !self::$piwikEnvironment) {
// Piwik 2.14.* compatibility fix
self::$piwikEnvironment = new \Piwik\Application\Environment(null);
self::$piwikEnvironment->init();
}
if (class_exists('Piwik\FrontController'))
\Piwik\FrontController::getInstance()->init();
else return array('result' => 'error', 'message' => __('Class Piwik\FrontController does not exists.','wp-piwik'));
if (class_exists('Piwik\API\Request'))
$request = new \Piwik\API\Request($params.'&token_auth='.self::$settings->getGlobalOption('piwik_token'));
else return array('result' => 'error', 'message' => __('Class Piwik\API\Request does not exists.','wp-piwik'));
if (isset($request))
$result = $request->process();
else $result = null;
if (!headers_sent())
header("Content-Type: text/html", true);
$result = $this->unserialize($result);
if ($GLOBALS ['wp-piwik_debug'])
self::$debug[$id] = array ( $params.'&token_auth=...' );
return $result;
}
}

View File

@ -1,81 +0,0 @@
<?php
namespace WP_Piwik\Request;
class Rest extends \WP_Piwik\Request {
protected function request($id) {
$count = 0;
if (self::$settings->getGlobalOption('piwik_mode') == 'http')
$url = self::$settings->getGlobalOption('piwik_url');
else if (self::$settings->getGlobalOption('piwik_mode') == 'cloud')
$url = 'https://'.self::$settings->getGlobalOption('piwik_user').'.innocraft.cloud/';
else $url = 'https://'.self::$settings->getGlobalOption('matomo_user').'.matomo.cloud/';
$params = 'module=API&method=API.getBulkRequest&format=json';
if (self::$settings->getGlobalOption('filter_limit') != "" && self::$settings->getGlobalOption('filter_limit') == (int) self::$settings->getGlobalOption('filter_limit'))
$params .= '&filter_limit='.self::$settings->getGlobalOption('filter_limit');
foreach (self::$requests as $requestID => $config) {
if (!isset(self::$results[$requestID])) {
$params .= '&urls['.$count.']='.urlencode($this->buildURL($config));
$map[$count] = $requestID;
$count++;
}
}
$results = ((function_exists('curl_init') && ini_get('allow_url_fopen') && self::$settings->getGlobalOption('http_connection') == 'curl') || (function_exists('curl_init') && !ini_get('allow_url_fopen')))?$this->curl($id, $url, $params):$this->fopen($id, $url, $params);
if (is_array($results))
foreach ($results as $num => $result)
if (isset($map[$num]))
self::$results[$map[$num]] = $result;
}
private function curl($id, $url, $params) {
if (self::$settings->getGlobalOption('http_method')=='post') {
$c = curl_init($url);
curl_setopt($c, CURLOPT_POST, 1);
curl_setopt($c, CURLOPT_POSTFIELDS, $params.'&token_auth='.self::$settings->getGlobalOption('piwik_token'));
} else $c = curl_init($url.'?'.$params.'&token_auth='.self::$settings->getGlobalOption('piwik_token'));
curl_setopt($c, CURLOPT_SSL_VERIFYPEER, !self::$settings->getGlobalOption('disable_ssl_verify'));
curl_setopt($c, CURLOPT_SSL_VERIFYHOST, !self::$settings->getGlobalOption('disable_ssl_verify_host')?2:0);
curl_setopt($c, CURLOPT_USERAGENT, self::$settings->getGlobalOption('piwik_useragent')=='php'?ini_get('user_agent'):self::$settings->getGlobalOption('piwik_useragent_string'));
curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($c, CURLOPT_HEADER, $GLOBALS ['wp-piwik_debug'] );
curl_setopt($c, CURLOPT_TIMEOUT, self::$settings->getGlobalOption('connection_timeout'));
$httpProxyClass = new \WP_HTTP_Proxy();
if ($httpProxyClass->is_enabled() && $httpProxyClass->send_through_proxy($url)) {
curl_setopt($c, CURLOPT_PROXY, $httpProxyClass->host());
curl_setopt($c, CURLOPT_PROXYPORT, $httpProxyClass->port());
if ($httpProxyClass->use_authentication())
curl_setopt($c, CURLOPT_PROXYUSERPWD, $httpProxyClass->username().':'.$httpProxyClass->password());
}
$result = curl_exec($c);
self::$lastError = curl_error($c);
if ($GLOBALS ['wp-piwik_debug']) {
$header_size = curl_getinfo($c, CURLINFO_HEADER_SIZE);
$header = substr($result, 0, $header_size);
$body = substr($result, $header_size);
$result = $this->unserialize($body);
self::$debug[$id] = array ( $header, $url.'?'.$params.'&token_auth=...' );
} else $result = $this->unserialize($result);
curl_close($c);
return $result;
}
private function fopen($id, $url, $params) {
$contextDefinition = array('http'=>array('timeout' => self::$settings->getGlobalOption('connection_timeout'), 'header' => "Content-type: application/x-www-form-urlencoded\r\n") );
$contextDefinition['ssl'] = array();
if (self::$settings->getGlobalOption('disable_ssl_verify'))
$contextDefinition['ssl'] = array('allow_self_signed' => true, 'verify_peer' => false );
if (self::$settings->getGlobalOption('disable_ssl_verify_host'))
$contextDefinition['ssl']['verify_peer_name'] = false;
if (self::$settings->getGlobalOption('http_method')=='post') {
$fullUrl = $url;
$contextDefinition['http']['method'] = 'POST';
$contextDefinition['http']['content'] = $params.'&token_auth='.self::$settings->getGlobalOption('piwik_token');
} else $fullUrl = $url.'?'.$params.'&token_auth='.self::$settings->getGlobalOption('piwik_token');
$context = stream_context_create($contextDefinition);
$result = $this->unserialize(@file_get_contents($fullUrl, false, $context));
if ($GLOBALS ['wp-piwik_debug'])
self::$debug[$id] = array ( get_headers($fullUrl, 1), $url.'?'.$params.'&token_auth=...' );
return $result;
}
}

View File

@ -1,408 +0,0 @@
<?php
namespace WP_Piwik;
/**
* Manage WP-Piwik settings
*
* @author Andr&eacute; Br&auml;kling
* @package WP_Piwik
*/
class Settings {
/**
*
* @var Environment variables and default settings container
*/
private static $wpPiwik, $defaultSettings;
/**
*
* @var Define callback functions for changed settings
*/
private $checkSettings = array (
'piwik_url' => 'checkPiwikUrl',
'piwik_token' => 'checkPiwikToken',
'site_id' => 'requestPiwikSiteID',
'tracking_code' => 'prepareTrackingCode',
'noscript_code' => 'prepareNocscriptCode'
);
/**
*
* @var Register default configuration set
*/
private $globalSettings = array (
// Plugin settings
'revision' => 0,
'last_settings_update' => 0,
// User settings: Piwik configuration
'piwik_mode' => 'http',
'piwik_url' => '',
'piwik_path' => '',
'piwik_user' => '',
'matomo_user' => '',
'piwik_token' => '',
'auto_site_config' => true,
// User settings: Stats configuration
'default_date' => 'yesterday',
'stats_seo' => false,
'stats_ecommerce' => false,
'dashboard_widget' => false,
'dashboard_ecommerce' => false,
'dashboard_chart' => false,
'dashboard_seo' => false,
'toolbar' => false,
'capability_read_stats' => array (
'administrator' => true
),
'perpost_stats' => false,
'plugin_display_name' => 'WP-Piwik',
'piwik_shortcut' => false,
'shortcodes' => false,
// User settings: Tracking configuration
'track_mode' => 'disabled',
'track_codeposition' => 'footer',
'track_noscript' => false,
'track_nojavascript' => false,
'proxy_url' => '',
'track_content' => 'disabled',
'track_search' => false,
'track_404' => false,
'add_post_annotations' => array(),
'add_customvars_box' => false,
'add_download_extensions' => '',
'set_download_extensions' => '',
'set_link_classes' => '',
'set_download_classes' => '',
'disable_cookies' => false,
'limit_cookies' => false,
'limit_cookies_visitor' => 34186669, // Piwik default 13 months
'limit_cookies_session' => 1800, // Piwik default 30 minutes
'limit_cookies_referral' => 15778463, // Piwik default 6 months
'track_admin' => false,
'capability_stealth' => array (),
'track_across' => false,
'track_across_alias' => false,
'track_crossdomain_linking' => false,
'track_feed' => false,
'track_feed_addcampaign' => false,
'track_feed_campaign' => 'feed',
'track_heartbeat' => 0,
'track_user_id' => 'disabled',
// User settings: Expert configuration
'cache' => true,
'http_connection' => 'curl',
'http_method' => 'post',
'disable_timelimit' => false,
'filter_limit' => '',
'connection_timeout' => 5,
'disable_ssl_verify' => false,
'disable_ssl_verify_host' => false,
'piwik_useragent' => 'php',
'piwik_useragent_string' => 'WP-Piwik',
'dnsprefetch' => false,
'track_datacfasync' => false,
'track_cdnurl' => '',
'track_cdnurlssl' => '',
'force_protocol' => 'disabled',
'update_notice' => 'enabled'
), $settings = array (
'name' => '',
'site_id' => NULL,
'noscript_code' => '',
'tracking_code' => '',
'last_tracking_code_update' => 0,
'dashboard_revision' => 0
), $settingsChanged = false;
/**
* Constructor class to prepare settings manager
*
* @param WP_Piwik $wpPiwik
* active WP-Piwik instance
*/
public function __construct($wpPiwik) {
self::$wpPiwik = $wpPiwik;
self::$wpPiwik->log ( 'Store default settings' );
self::$defaultSettings = array (
'globalSettings' => $this->globalSettings,
'settings' => $this->settings
);
self::$wpPiwik->log ( 'Load settings' );
foreach ( $this->globalSettings as $key => $default ) {
$this->globalSettings [$key] = ($this->checkNetworkActivation () ? get_site_option ( 'wp-piwik_global-' . $key, $default ) : get_option ( 'wp-piwik_global-' . $key, $default ));
}
foreach ( $this->settings as $key => $default )
$this->settings [$key] = get_option ( 'wp-piwik-' . $key, $default );
}
/**
* Save all settings as WordPress options
*/
public function save() {
if (! $this->settingsChanged) {
self::$wpPiwik->log ( 'No settings changed yet' );
return;
}
self::$wpPiwik->log ( 'Save settings' );
foreach ( $this->globalSettings as $key => $value ) {
if ( $this->checkNetworkActivation() )
update_site_option ( 'wp-piwik_global-' . $key, $value );
else
update_option ( 'wp-piwik_global-' . $key, $value );
}
foreach ( $this->settings as $key => $value ) {
update_option ( 'wp-piwik-' . $key, $value );
}
global $wp_roles;
if (! is_object ( $wp_roles ))
$wp_roles = new \WP_Roles ();
if (! is_object ( $wp_roles ))
die ( "STILL NO OBJECT" );
foreach ( $wp_roles->role_names as $strKey => $strName ) {
$objRole = get_role ( $strKey );
foreach ( array (
'stealth',
'read_stats'
) as $strCap ) {
$aryCaps = $this->getGlobalOption ( 'capability_' . $strCap );
if (isset ( $aryCaps [$strKey] ) && $aryCaps [$strKey])
$wp_roles->add_cap ( $strKey, 'wp-piwik_' . $strCap );
else $wp_roles->remove_cap ( $strKey, 'wp-piwik_' . $strCap );
}
}
$this->settingsChanged = false;
}
/**
* Get a global option's value
*
* @param string $key
* option key
* @return string option value
*/
public function getGlobalOption($key) {
return isset ( $this->globalSettings [$key] ) ? $this->globalSettings [$key] : self::$defaultSettings ['globalSettings'] [$key];
}
/**
* Get an option's value related to a specific blog
*
* @param string $key
* option key
* @param int $blogID
* blog ID (default: current blog)
* @return \WP_Piwik\Register
*/
public function getOption($key, $blogID = null) {
if ($this->checkNetworkActivation () && ! empty ( $blogID )) {
return get_blog_option ( $blogID, 'wp-piwik-'.$key );
}
return isset ( $this->settings [$key] ) ? $this->settings [$key] : self::$defaultSettings ['settings'] [$key];
}
/**
* Set a global option's value
*
* @param string $key
* option key
* @param string $value
* new option value
*/
public function setGlobalOption($key, $value) {
$this->settingsChanged = true;
self::$wpPiwik->log ( 'Changed global option ' . $key . ': ' . (is_array ( $value ) ? serialize ( $value ) : $value) );
$this->globalSettings [$key] = $value;
}
/**
* Set an option's value related to a specific blog
*
* @param string $key
* option key
* @param int $blogID
* blog ID (default: current blog)
* @param string $value
* new option value
*/
public function setOption($key, $value, $blogID = null) {
$this->settingsChanged = true;
self::$wpPiwik->log ( 'Changed option ' . $key . ': ' . $value );
if ($this->checkNetworkActivation () && ! empty ( $blogID )) {
add_blog_option ( $blogID, 'wp-piwik-'.$key, $value );
} else
$this->settings [$key] = $value;
}
/**
* Reset settings to default
*/
public function resetSettings() {
self::$wpPiwik->log ( 'Reset WP-Piwik settings' );
global $wpdb;
if ( $this->checkNetworkActivation() ) {
$aryBlogs = self::getBlogList();
if (is_array($aryBlogs))
foreach ($aryBlogs as $aryBlog) {
switch_to_blog($aryBlog['blog_id']);
$wpdb->query("DELETE FROM $wpdb->options WHERE option_name LIKE 'wp-piwik-%'");
restore_current_blog();
}
$wpdb->query("DELETE FROM $wpdb->sitemeta WHERE meta_key LIKE 'wp-piwik_global-%'");
}
else $wpdb->query("DELETE FROM $wpdb->options WHERE option_name LIKE 'wp-piwik_global-%'");
}
/**
* Get blog list
*/
public static function getBlogList($limit = null, $page = null, $search = '') {
if ($limit && $page)
$queryLimit = ' LIMIT '.(int) (($page - 1) * $limit).','.(int) $limit;
global $wpdb;
return $wpdb->get_results($wpdb->prepare('SELECT blog_id FROM '.$wpdb->blogs.' WHERE CONCAT(domain, path) LIKE "%%%s%%" AND spam = 0 AND deleted = 0 ORDER BY blog_id'.$queryLimit, $search), ARRAY_A);
}
/**
* Check if plugin is network activated
*
* @return boolean Is network activated?
*/
public function checkNetworkActivation() {
if (! function_exists ( "is_plugin_active_for_network" ))
require_once (ABSPATH . 'wp-admin/includes/plugin.php');
return is_plugin_active_for_network ( 'wp-piwik/wp-piwik.php' );
}
/**
* Apply new configuration
*
* @param array $in
* new configuration set
*/
public function applyChanges($in) {
if (!self::$wpPiwik->isValidOptionsPost())
die("Invalid config changes.");
$in = $this->checkSettings ( $in );
self::$wpPiwik->log ( 'Apply changed settings:' );
foreach ( self::$defaultSettings ['globalSettings'] as $key => $val )
$this->setGlobalOption ( $key, isset ( $in [$key] ) ? $in [$key] : $val );
foreach ( self::$defaultSettings ['settings'] as $key => $val )
$this->setOption ( $key, isset ( $in [$key] ) ? $in [$key] : $val );
$this->setGlobalOption ( 'last_settings_update', time () );
$this->save ();
}
/**
* Apply callback function on new settings
*
* @param array $in
* new configuration set
* @return array configuration set after callback functions were applied
*/
private function checkSettings($in) {
foreach ( $this->checkSettings as $key => $value )
if (isset ( $in [$key] ))
$in [$key] = call_user_func_array ( array (
$this,
$value
), array (
$in [$key],
$in
) );
return $in;
}
/**
* Add slash to Piwik URL if necessary
*
* @param string $value
* Piwik URL
* @param array $in
* configuration set
* @return string Piwik URL
*/
private function checkPiwikUrl($value, $in) {
return substr ( $value, - 1, 1 ) != '/' ? $value . '/' : $value;
}
/**
* Remove &amp;token_auth= from auth token
*
* @param string $value
* Piwik auth token
* @param array $in
* configuration set
* @return string Piwik auth token
*/
private function checkPiwikToken($value, $in) {
return str_replace ( '&token_auth=', '', $value );
}
/**
* Request the site ID (if not set before)
*
* @param string $value
* tracking code
* @param array $in
* configuration set
* @return int Piwik site ID
*/
private function requestPiwikSiteID($value, $in) {
if ($in ['auto_site_config'] && ! $value)
return self::$wpPiwik->getPiwikSiteId();
return $value;
}
/**
* Prepare the tracking code
*
* @param string $value
* tracking code
* @param array $in
* configuration set
* @return string tracking code
*/
private function prepareTrackingCode($value, $in) {
if ($in ['track_mode'] == 'manually' || $in ['track_mode'] == 'disabled') {
$value = stripslashes ( $value );
if ($this->checkNetworkActivation ())
add_site_option ( 'wp-piwik-manually', $value );
return $value;
}
/*$result = self::$wpPiwik->updateTrackingCode ();
echo '<pre>'; print_r($result); echo '</pre>';
$this->setOption ( 'noscript_code', $result ['noscript'] );*/
return; // $result ['script'];
}
/**
* Prepare the nocscript code
*
* @param string $value
* noscript code
* @param array $in
* configuration set
* @return string noscript code
*/
private function prepareNocscriptCode($value, $in) {
if ($in ['track_mode'] == 'manually')
return stripslashes ( $value );
return $this->getOption ( 'noscript_code' );
}
/**
* Get debug data
*
* @return array WP-Piwik settings for debug output
*/
public function getDebugData() {
$debug = array(
'global_settings' => $this->globalSettings,
'settings' => $this->settings
);
$debug['global_settings']['piwik_token'] = !empty($debug['global_settings']['piwik_token'])?'set':'not set';
return $debug;
}
}

View File

@ -1,28 +0,0 @@
<?php
namespace WP_Piwik;
class Shortcode {
private $available = array(
'opt-out' => 'OptOut',
'post' => 'Post',
'overview' => 'Overview'
), $content;
public function __construct($attributes, $wpPiwik, $settings) {
$wpPiwik->log('Check requested shortcode widget '.$attributes['module']);
if (isset($attributes['module']) && isset($this->available[$attributes['module']])) {
$wpPiwik->log('Add shortcode widget '.$this->available[$attributes['module']]);
$class = '\\WP_Piwik\\Widget\\'.$this->available[$attributes['module']];
$widget = new $class($wpPiwik, $settings, null, null, null, $attributes, true);
$widget->show();
$this->content = $widget->get();
}
}
public function get() {
return $this->content;
}
}

View File

@ -1,31 +0,0 @@
<?php
namespace WP_Piwik;
class Template {
public static $logger, $settings, $wpPiwik;
public function __construct($wpPiwik, $settings) {
self::$settings = $settings;
self::$wpPiwik = $wpPiwik;
}
public function output($array, $key, $default = '') {
if (isset($array[$key]))
return $array[$key];
else
return $default;
}
public function tabRow($name, $value) {
echo '<tr><td>'.$name.'</td><td>'.$value.'</td></tr>';
}
public function getRangeLast30() {
$diff = (self::$settings->getGlobalOption('default_date') == 'yesterday') ? -86400 : 0;
$end = time() + $diff;
$start = time() - 2592000 + $diff;
return date('Y-m-d', $start).','.date('Y-m-d', $end);
}
}

View File

@ -1,63 +0,0 @@
<?php
namespace WP_Piwik\Template;
class MetaBoxCustomVars extends \WP_Piwik\Template {
public function addMetabox() {
add_meta_box(
'wp-piwik_post_customvars',
__('Piwik Custom Variables', 'wp-piwik'),
array(&$this, 'showCustomvars'),
array('post', 'page', 'custom_post_type'),
'side',
'default'
);
}
public function showCustomvars($objPost, $objBox ) {
wp_nonce_field(basename( __FILE__ ), 'wp-piwik_post_customvars_nonce'); ?>
<table>
<tr><th></th><th><?php _e('Name', 'wp-piwik'); ?></th><th><?php _e('Value', 'wp-piwik'); ?></th></tr>
<?php for($i = 1; $i <= 5; $i++) { ?>
<tr>
<th><label for="wp-piwik_customvar1"><?php echo $i; ?>: </label></th>
<td><input class="widefat" type="text" name="wp-piwik_custom_cat<?php echo $i; ?>" value="<?php echo esc_attr(get_post_meta($objPost->ID, 'wp-piwik_custom_cat'.$i, true ) ); ?>" size="200" /></td>
<td><input class="widefat" type="text" name="wp-piwik_custom_val<?php echo $i; ?>" value="<?php echo esc_attr(get_post_meta($objPost->ID, 'wp-piwik_custom_val'.$i, true ) ); ?>" size="200" /></td>
</tr>
<?php } ?>
</table>
<p><?php _e('Set custom variables for a page view', 'wp-piwik'); ?>. (<a href="http://piwik.org/docs/custom-variables/"><?php _e('More information', 'wp-piwik'); ?></a>.)</p>
<?php
}
public function saveCustomVars($intID, $objPost) {
// Verify the nonce before proceeding.
if (!isset( $_POST['wp-piwik_post_customvars_nonce'] ) || !wp_verify_nonce( $_POST['wp-piwik_post_customvars_nonce'], basename( __FILE__ ) ) )
return $intID;
// Get post type object
$objPostType = get_post_type_object($objPost->post_type);
// Check if the current user has permission to edit the post.
if (!current_user_can($objPostType->cap->edit_post, $intID))
return $intID;
$aryNames = array('cat', 'val');
for ($i = 1; $i <= 5; $i++)
for ($j = 0; $j <= 1; $j++) {
// Get data
$strMetaVal = (isset($_POST['wp-piwik_custom_'.$aryNames[$j].$i])?htmlentities($_POST['wp-piwik_custom_'.$aryNames[$j].$i]):'');
// Create key
$strMetaKey = 'wp-piwik_custom_'.$aryNames[$j].$i;
// Get the meta value of the custom field key
$strCurVal = get_post_meta($intID, $strMetaKey, true);
// Add meta val:
if ($strMetaVal && '' == $strCurVal)
add_post_meta($intID, $strMetaKey, $strMetaVal, true);
// Update meta val:
elseif ($strMetaVal && $strMetaVal != $strCurVal)
update_post_meta($intID, $strMetaKey, $strMetaVal);
// Delete meta val:
elseif (''==$strMetaVal && $strCurVal)
delete_post_meta($intID, $strMetaKey, $strCurVal);
}
}
}

View File

@ -1,154 +0,0 @@
<?php
namespace WP_Piwik;
class TrackingCode {
private static $wpPiwik, $piwikUrl = false;
private $trackingCode;
public $is404 = false, $isSearch = false, $isUsertracking = false;
public function __construct($wpPiwik) {
self::$wpPiwik = $wpPiwik;
if (! self::$wpPiwik->isCurrentTrackingCode () || ! self::$wpPiwik->getOption ( 'tracking_code' ) || strpos( self::$wpPiwik->getOption ( 'tracking_code' ), '{"result":"error",' ) !== false )
self::$wpPiwik->updateTrackingCode ();
$this->trackingCode = (self::$wpPiwik->isNetworkMode () && self::$wpPiwik->getGlobalOption ( 'track_mode' ) == 'manually') ? get_site_option ( 'wp-piwik-manually' ) : self::$wpPiwik->getOption ( 'tracking_code' );
}
public function getTrackingCode() {
if ($this->isUsertracking)
$this->applyUserTracking ();
if ($this->is404)
$this->apply404Changes ();
if ($this->isSearch)
$this->applySearchChanges ();
if (is_single () || is_page())
$this->addCustomValues ();
$this->trackingCode = apply_filters('wp-piwik_tracking_code', $this->trackingCode);
return $this->trackingCode;
}
public static function prepareTrackingCode($code, $settings, $logger) {
global $current_user;
$logger->log ( 'Apply tracking code changes:' );
$settings->setOption ( 'last_tracking_code_update', time () );
if (preg_match ( '/var u="([^"]*)";/', $code, $hits )) {
$fetchedProxyUrl = $hits [1];
} else $fetchedProxyUrl = '';
if ($settings->getGlobalOption ( 'track_mode' ) == 'js')
$code = str_replace ( array (
'piwik.js',
'piwik.php',
'matomo.js',
'matomo.php'
), 'js/index.php', $code );
elseif ($settings->getGlobalOption ( 'track_mode' ) == 'proxy') {
$code = str_replace ( 'piwik.js', 'piwik.php', $code );
$code = str_replace ( 'matomo.js', 'matomo.php', $code );
$proxy = str_replace ( array (
'https://',
'http://'
), '//', plugins_url ( 'wp-piwik' ) . '/proxy' ) . '/';
$code = preg_replace ( '/var u="([^"]*)";/', 'var u="' . $proxy . '"', $code );
$code = preg_replace ( '/img src="([^"]*)piwik.php/', 'img src="' . $proxy . 'piwik.php', $code );
$code = preg_replace ( '/img src="([^"]*)matomo.php/', 'img src="' . $proxy . 'matomo.php', $code );
}
if ($settings->getGlobalOption ( 'track_cdnurl' ) || $settings->getGlobalOption ( 'track_cdnurlssl' ))
$code = str_replace ( array (
"var d=doc",
"g.src=u+"
), array (
"var ucdn=(('https:' == document.location.protocol) ? 'https://" . ($settings->getGlobalOption ( 'track_cdnurlssl' ) ? $settings->getGlobalOption ( 'track_cdnurlssl' ) : $settings->getGlobalOption ( 'track_cdnurl' )) . "/' : 'http://" . ($settings->getGlobalOption ( 'track_cdnurl' ) ? $settings->getGlobalOption ( 'track_cdnurl' ) : $settings->getGlobalOption ( 'track_cdnurlssl' )) . "/');\nvar d=doc",
"g.src=ucdn+"
), $code );
if ($settings->getGlobalOption ( 'track_datacfasync' ))
$code = str_replace ( '<script type', '<script data-cfasync="false" type', $code );
if ($settings->getGlobalOption ( 'set_download_extensions' ))
$code = str_replace ( "_paq.push(['trackPageView']);", "_paq.push(['setDownloadExtensions', '" . ($settings->getGlobalOption ( 'set_download_extensions' )) . "']);\n_paq.push(['trackPageView']);", $code );
if ($settings->getGlobalOption ( 'add_download_extensions' ))
$code = str_replace ( "_paq.push(['trackPageView']);", "_paq.push(['addDownloadExtensions', '" . ($settings->getGlobalOption ( 'add_download_extensions' )) . "']);\n_paq.push(['trackPageView']);", $code );
if ($settings->getGlobalOption ( 'set_download_classes' ))
$code = str_replace ( "_paq.push(['trackPageView']);", "_paq.push(['setDownloadClasses', '" . ($settings->getGlobalOption ( 'set_download_classes' )) . "']);\n_paq.push(['trackPageView']);", $code );
if ($settings->getGlobalOption ( 'set_link_classes' ))
$code = str_replace ( "_paq.push(['trackPageView']);", "_paq.push(['setLinkClasses', '" . ($settings->getGlobalOption ( 'set_link_classes' )) . "']);\n_paq.push(['trackPageView']);", $code );
if ($settings->getGlobalOption ( 'limit_cookies' ))
$code = str_replace ( "_paq.push(['trackPageView']);", "_paq.push(['setVisitorCookieTimeout', '" . $settings->getGlobalOption ( 'limit_cookies_visitor' ) . "']);\n_paq.push(['setSessionCookieTimeout', '" . $settings->getGlobalOption ( 'limit_cookies_session' ) . "']);\n_paq.push(['setReferralCookieTimeout', '" . $settings->getGlobalOption ( 'limit_cookies_referral' ) . "']);\n_paq.push(['trackPageView']);", $code );
if ($settings->getGlobalOption ( 'force_protocol' ) != 'disabled')
$code = str_replace ( '"//', '"' . $settings->getGlobalOption ( 'force_protocol' ) . '://', $code );
if ($settings->getGlobalOption ( 'track_content' ) == 'all')
$code = str_replace ( "_paq.push(['trackPageView']);", "_paq.push(['trackPageView']);\n_paq.push(['trackAllContentImpressions']);", $code );
elseif ($settings->getGlobalOption ( 'track_content' ) == 'visible')
$code = str_replace ( "_paq.push(['trackPageView']);", "_paq.push(['trackPageView']);\n_paq.push(['trackVisibleContentImpressions']);", $code );
if ((int) $settings->getGlobalOption ( 'track_heartbeat' ) > 0)
$code = str_replace ( "_paq.push(['trackPageView']);", "_paq.push(['trackPageView']);\n_paq.push(['enableHeartBeatTimer', ".(int) $settings->getGlobalOption ( 'track_heartbeat' )."]);", $code );
$noScript = array ();
preg_match ( '/<noscript>(.*)<\/noscript>/', $code, $noScript );
if (isset ( $noScript [0] )) {
if ($settings->getGlobalOption ( 'track_nojavascript' ))
$noScript [0] = str_replace ( '?idsite', '?rec=1&idsite', $noScript [0] );
$noScript = $noScript [0];
} else
$noScript = '';
$script = preg_replace ( '/<noscript>(.*)<\/noscript>/', '', $code );
$script = preg_replace ( '/\s+(\r\n|\r|\n)/', '$1', $script );
$logger->log ( 'Finished tracking code: ' . $script );
$logger->log ( 'Finished noscript code: ' . $noScript );
return array (
'script' => $script,
'noscript' => $noScript,
'proxy' => $fetchedProxyUrl
);
}
private function apply404Changes() {
self::$wpPiwik->log ( 'Apply 404 changes. Blog ID: ' . get_current_blog_id () . ' Site ID: ' . self::$wpPiwik->getOption ( 'site_id' ) );
$this->trackingCode = str_replace ( "_paq.push(['trackPageView']);", "_paq.push(['setDocumentTitle', '404/URL = '+String(document.location.pathname+document.location.search).replace(/\//g,'%2f') + '/From = ' + String(document.referrer).replace(/\//g,'%2f')]);\n_paq.push(['trackPageView']);", $this->trackingCode );
}
private function applySearchChanges() {
self::$wpPiwik->log ( 'Apply search tracking changes. Blog ID: ' . get_current_blog_id () . ' Site ID: ' . self::$wpPiwik->getOption ( 'site_id' ) );
$objSearch = new \WP_Query ( "s=" . get_search_query () . '&showposts=-1' );
$intResultCount = $objSearch->post_count;
$this->trackingCode = str_replace ( "_paq.push(['trackPageView']);", "_paq.push(['trackSiteSearch','" . get_search_query () . "', false, " . $intResultCount . "]);\n_paq.push(['trackPageView']);", $this->trackingCode );
}
private function applyUserTracking() {
$pkUserId = null;
if (\is_user_logged_in()) {
// Get the User ID Admin option, and the current user's data
$uidFrom = self::$wpPiwik->getGlobalOption ( 'track_user_id' );
$current_user = wp_get_current_user(); // current user
// Get the user ID based on the admin setting
if ( $uidFrom == 'uid' ) {
$pkUserId = $current_user->ID;
} elseif ( $uidFrom == 'email' ) {
$pkUserId = $current_user->user_email;
} elseif ( $uidFrom == 'username' ) {
$pkUserId = $current_user->user_login;
} elseif ( $uidFrom == 'displayname' ) {
$pkUserId = $current_user->display_name;
}
}
$pkUserId = apply_filters('wp-piwik_tracking_user_id', $pkUserId);
// Check we got a User ID to track, and track it
if ( isset( $pkUserId ) && ! empty( $pkUserId ))
$this->trackingCode = str_replace ( "_paq.push(['trackPageView']);", "_paq.push(['setUserId', '" . esc_js( $pkUserId ) . "']);\n_paq.push(['trackPageView']);", $this->trackingCode );
}
private function addCustomValues() {
$customVars = '';
for($i = 1; $i <= 5; $i ++) {
$postId = get_the_ID ();
$metaKey = get_post_meta ( $postId, 'wp-piwik_custom_cat' . $i, true );
$metaVal = get_post_meta ( $postId, 'wp-piwik_custom_val' . $i, true );
if (! empty ( $metaKey ) && ! empty ( $metaVal ))
$customVars .= "_paq.push(['setCustomVariable'," . $i . ", '" . $metaKey . "', '" . $metaVal . "', 'page']);\n";
}
if (! empty ( $customVars ))
$this->trackingCode = str_replace ( "_paq.push(['trackPageView']);", $customVars . "_paq.push(['trackPageView']);", $this->trackingCode );
}
}

View File

@ -1,376 +0,0 @@
<?php
namespace WP_Piwik;
/**
* Abstract widget class
*
* @author Andr&eacute; Br&auml;kling
* @package WP_Piwik
*/
abstract class Widget {
/**
*
* @var Environment variables
*/
protected static $wpPiwik, $settings;
/**
*
* @var Configuration parameters
*/
protected $isShortcode = false, $method = '', $title = '', $context = 'side', $priority = 'core', $parameter = array (), $apiID = array (), $pageId = 'dashboard', $blogId = null, $name = 'Value', $limit = 10, $content = '', $output = '';
/**
* Widget constructor
*
* @param WP_Piwik $wpPiwik
* current WP-Piwik object
* @param WP_Piwik\Settings $settings
* current WP-Piwik settings
* @param string $pageId
* WordPress page ID (default: dashboard)
* @param string $context
* WordPress meta box context (defualt: side)
* @param string $priority
* WordPress meta box priority (default: default)
* @param array $params
* widget parameters (default: empty array)
* @param boolean $isShortcode
* is the widget shown inline? (default: false)
*/
public function __construct($wpPiwik, $settings, $pageId = 'dashboard', $context = 'side', $priority = 'default', $params = array(), $isShortcode = false) {
self::$wpPiwik = $wpPiwik;
self::$settings = $settings;
$this->pageId = $pageId;
$this->context = $context;
$this->priority = $priority;
if (self::$settings->checkNetworkActivation () && function_exists ( 'is_super_admin' ) && is_super_admin () && isset ( $_GET ['wpmu_show_stats'] )) {
switch_to_blog ( ( int ) $_GET ['wpmu_show_stats'] );
$this->blogId = get_current_blog_id ();
restore_current_blog ();
}
$this->isShortcode = $isShortcode;
$prefix = ($this->pageId == 'dashboard' ? self::$settings->getGlobalOption ( 'plugin_display_name' ) . ' - ' : '');
$this->configure ( $prefix, $params );
if (is_array ( $this->method ))
foreach ( $this->method as $method ) {
$this->apiID [$method] = \WP_Piwik\Request::register ( $method, $this->parameter );
self::$wpPiwik->log ( "Register request: " . $this->apiID [$method] );
}
else {
$this->apiID [$this->method] = \WP_Piwik\Request::register ( $this->method, $this->parameter );
self::$wpPiwik->log ( "Register request: " . $this->apiID [$this->method] );
}
if ($this->isShortcode)
return;
add_meta_box ( $this->getName (), $this->title, array (
$this,
'show'
), $pageId, $this->context, $this->priority );
}
/**
* Conifguration dummy method
*
* @param string $prefix
* metabox title prefix (default: empty)
* @param array $params
* widget parameters (default: empty array)
*/
protected function configure($prefix = '', $params = array()) {
}
/**
* Default show widget method, handles default Piwik output
*/
public function show() {
$response = self::$wpPiwik->request ( $this->apiID [$this->method] );
if (! empty ( $response ['result'] ) && $response ['result'] == 'error')
$this->out( '<strong>' . __ ( 'Piwik error', 'wp-piwik' ) . ':</strong> ' . htmlentities ( $response ['message'], ENT_QUOTES, 'utf-8' ) );
else {
if (isset ( $response [0] ['nb_uniq_visitors'] ))
$unique = 'nb_uniq_visitors';
else
$unique = 'sum_daily_nb_uniq_visitors';
$tableHead = array (
'label' => __ ( $this->name, 'wp-piwik' )
);
$tableHead [$unique] = __ ( 'Unique', 'wp-piwik' );
if (isset ( $response [0] ['nb_visits'] ))
$tableHead ['nb_visits'] = __ ( 'Visits', 'wp-piwik' );
if (isset ( $response [0] ['nb_hits'] ))
$tableHead ['nb_hits'] = __ ( 'Hits', 'wp-piwik' );
if (isset ( $response [0] ['nb_actions'] ))
$tableHead ['nb_actions'] = __ ( 'Actions', 'wp-piwik' );
$tableBody = array ();
$count = 0;
if (is_array($response))
foreach ( $response as $rowKey => $row ) {
$count ++;
$tableBody [$rowKey] = array ();
foreach ( $tableHead as $key => $value )
$tableBody [$rowKey] [] = isset ( $row [$key] ) ? $row [$key] : '-';
if ($count == 10)
break;
}
$this->table ( $tableHead, $tableBody, null );
}
}
/**
* Display or store shortcode output
*/
protected function out($output) {
if ($this->isShortcode)
$this->output .= $output;
else echo $output;
}
/**
* Return shortcode output
*/
public function get() {
return $this->output;
}
/**
* Display a HTML table
*
* @param array $thead
* table header content (array of cells)
* @param array $tbody
* table body content (array of rows)
* @param array $tfoot
* table footer content (array of cells)
* @param string $class
* CSSclass name to apply on table sections
* @param string $javaScript
* array of javascript code to apply on body rows
*/
protected function table($thead, $tbody = array(), $tfoot = array(), $class = false, $javaScript = array(), $classes = array()) {
$this->out( '<div class="table"><table class="widefat wp-piwik-table">' );
if ($this->isShortcode && $this->title) {
$colspan = !empty ( $tbody ) ? count( $tbody[0] ) : 2 ;
$this->out( '<tr><th colspan="'.$colspan.'">' . $this->title . '</th></tr>' );
}
if (! empty ( $thead ))
$this->tabHead ( $thead, $class );
if (! empty ( $tbody ))
$this->tabBody ( $tbody, $class, $javaScript, $classes );
else
$this->out( '<tr><td colspan="10">' . __ ( 'No data available.', 'wp-piwik' ) . '</td></tr>' );
if (! empty ( $tfoot ))
$this->tabFoot ( $tfoot, $class );
$this->out( '</table></div>' );
}
/**
* Display a HTML table header
*
* @param array $thead
* array of cells
* @param string $class
* CSS class to apply
*/
private function tabHead($thead, $class = false) {
$this->out( '<thead' . ($class ? ' class="' . $class . '"' : '') . '><tr>' );
$count = 0;
foreach ( $thead as $value )
$this->out( '<th' . ($count ++ ? ' class="right"' : '') . '>' . $value . '</th>' );
$this->out( '</tr></thead>' );
}
/**
* Display a HTML table body
*
* @param array $tbody
* array of rows, each row containing an array of cells
* @param string $class
* CSS class to apply
* @param unknown $javaScript
* array of javascript code to apply (one item per row)
*/
private function tabBody($tbody, $class = false, $javaScript = array(), $classes = array()) {
$this->out( '<tbody' . ($class ? ' class="' . $class . '"' : '') . '>' );
foreach ( $tbody as $key => $trow )
$this->tabRow ( $trow, isset( $javaScript [$key] ) ?$javaScript [$key] : '', isset ( $classes [$key] ) ?$classes [$key] : '');
$this->out( '</tbody>' );
}
/**
* Display a HTML table footer
*
* @param array $tfoor
* array of cells
* @param string $class
* CSS class to apply
*/
private function tabFoot($tfoot, $class = false) {
$this->out( '<tfoot' . ($class ? ' class="' . $class . '"' : '') . '><tr>' );
$count = 0;
foreach ( $tfoot as $value )
$this->out( '<td' . ($count ++ ? ' class="right"' : '') . '>' . $value . '</td>' );
$this->out( '</tr></tfoot>' );
}
/**
* Display a HTML table row
*
* @param array $trow
* array of cells
* @param string $javaScript
* javascript code to apply
*/
private function tabRow($trow, $javaScript = '', $class = '') {
$this->out( '<tr' . (! empty ( $javaScript ) ? ' onclick="' . $javaScript . '"' : '') . (! empty ( $class ) ? ' class="' . $class . '"' : '') . '>' );
$count = 0;
foreach ( $trow as $tcell )
$this->out( '<td' . ($count ++ ? ' class="right"' : '') . '>' . $tcell . '</td>' );
$this->out( '</tr>' );
}
/**
* Get the current request's Piwik time settings
*
* @return array time settings: period => Piwik period, date => requested date, description => time description to show in widget title
*/
protected function getTimeSettings() {
switch (self::$settings->getGlobalOption ( 'default_date' )) {
case 'today' :
$period = 'day';
$date = 'today';
$description = __('today', 'wp-piwik' );
break;
case 'current_month' :
$period = 'month';
$date = 'today';
$description = __('current month', 'wp-piwik' );
break;
case 'last_month' :
$period = 'month';
$date = date ( "Y-m-d", strtotime ( "last day of previous month" ) );
$description = __('last month', 'wp-piwik' );
break;
case 'current_week' :
$period = 'week';
$date = 'today';
$description = __('current week', 'wp-piwik' );
break;
case 'last_week' :
$period = 'week';
$date = date ( "Y-m-d", strtotime ( "-1 week" ) );
$description = __('last week', 'wp-piwik' );
break;
case 'yesterday' :
$period = 'day';
$date = 'yesterday';
$description = __('yesterday', 'wp-piwik' );
break;
default :
break;
}
return array (
'period' => $period,
'date' => isset ( $_GET ['date'] ) ? ( int ) $_GET ['date'] : $date,
'description' => isset ( $_GET ['date'] ) ? $this->dateFormat ( $_GET ['date'], $period ) : $description
);
}
/**
* Format a date to show in widget
*
* @param string $date
* date string
* @param string $period
* Piwik period
* @return string formatted date
*/
protected function dateFormat($date, $period = 'day') {
$prefix = '';
switch ($period) {
case 'week' :
$prefix = __ ( 'week', 'wp-piwik' ) . ' ';
$format = 'W/Y';
break;
case 'short_week' :
$format = 'W';
break;
case 'month' :
$format = 'F Y';
$date = date ( 'Y-m-d', strtotime ( $date ) );
break;
default :
$format = get_option ( 'date_format' );
}
return $prefix . date_i18n ( $format, strtotime ( $date ) );
}
/**
* Format time to show in widget
*
* @param int $time
* time in seconds
* @return string formatted time
*/
protected function timeFormat($time) {
return floor ( $time / 3600 ) . 'h ' . floor ( ($time % 3600) / 60 ) . 'm ' . floor ( ($time % 3600) % 60 ) . 's';
}
/**
* Convert Piwik range into meaningful text
*
* @return string range description
*/
public function rangeName() {
switch ($this->parameter ['date']) {
case 'last30' :
return __('last 30 days', 'wp-piwik' );
case 'last12' :
return __('last 12 ' . $this->parameter ['period'] . 's', 'wp-piwik' );
default :
return $this->parameter ['date'];
}
}
/**
* Get the widget name
*
* @return string widget name
*/
public function getName() {
return str_replace ( '\\', '-', get_called_class () );
}
/**
* Display a pie chart
*
* @param
* array chart data array(array(0 => name, 1 => value))
*/
public function pieChart($data) {
$this->out( '<div id="wp-piwik_stats_' . $this->getName () . '_graph" style="height:310px;width:100%"></div>' );
$this->out( '<script type="text/javascript">$plotBrowsers = $j.jqplot("wp-piwik_stats_' . $this->getName () . '_graph", [[' );
$list = '';
foreach ( $data as $key => $dataSet ) {
$list .= '["' . $dataSet [0] . '", ' . $dataSet [1] . '],';
if ($key == 'Others') break;
}
$this->out( substr ( $list, 0, - 1 ) );
$this->out( ']], {seriesDefaults:{renderer:$j.jqplot.PieRenderer, rendererOptions:{sliceMargin:8}},legend:{show:true}});</script>' );
}
/**
* Return an array value by key, return '-' if not set
*
* @param array $array
* array to get a value from
* @param string $key
* key of the value to get from array
* @return string found value or '-' as a placeholder
*/
protected function value($array, $key) {
return (isset ( $array [$key] ) ? $array [$key] : '-');
}
}

View File

@ -1,77 +0,0 @@
<?php
namespace WP_Piwik\Widget;
use WP_Piwik\Widget;
class BrowserDetails extends Widget {
public $className = __CLASS__;
protected function configure($prefix = '', $params = array()) {
$timeSettings = $this->getTimeSettings();
$this->parameter = array(
'idSite' => self::$wpPiwik->getPiwikSiteId($this->blogId),
'period' => $timeSettings['period'],
'date' => $timeSettings['date']
);
$this->title = $prefix.__('Browser Details', 'wp-piwik').' ('.__($timeSettings['description'],'wp-piwik').')';
$this->method = 'DevicesDetection.getBrowserVersions';
$this->context = 'normal';
wp_enqueue_script('wp-piwik', self::$wpPiwik->getPluginURL().'js/wp-piwik.js', array(), self::$wpPiwik->getPluginVersion(), true);
wp_enqueue_script('wp-piwik-jqplot',self::$wpPiwik->getPluginURL().'js/jqplot/wp-piwik.jqplot.js',array('jquery'));
wp_enqueue_style('wp-piwik', self::$wpPiwik->getPluginURL().'css/wp-piwik.css',array(),self::$wpPiwik->getPluginVersion());
add_action('admin_head-index.php', array($this, 'addHeaderLines'));
}
public function addHeaderLines() {
echo '<!--[if IE]><script language="javascript" type="text/javascript" src="'.self::$wpPiwik->getPluginURL().'js/jqplot/excanvas.min.js"></script><![endif]-->';
echo '<link rel="stylesheet" href="'.self::$wpPiwik->getPluginURL().'js/jqplot/jquery.jqplot.min.css" type="text/css"/>';
echo '<script type="text/javascript">var $j = jQuery.noConflict();</script>';
}
public function show() {
$response = self::$wpPiwik->request($this->apiID[$this->method]);
$tableBody = array();
if (!empty($response['result']) && $response['result'] ='error')
echo '<strong>'.__('Piwik error', 'wp-piwik').':</strong> '.htmlentities($response['message'], ENT_QUOTES, 'utf-8');
else {
$tableHead = array(__('Browser', 'wp-piwik'), __('Unique', 'wp-piwik'), __('Percent', 'wp-piwik'));
if (isset($response[0]['nb_uniq_visitors'])) $unique = 'nb_uniq_visitors';
else $unique = 'sum_daily_nb_uniq_visitors';
$count = 0;
$sum = 0;
$js = array();
$class = array();
if (is_array($response))
foreach ($response as $row) {
$count++;
$sum += isset($row[$unique])?$row[$unique]:0;
if ($count < $this->limit)
$tableBody[$row['label']] = array($row['label'], $row[$unique], 0);
elseif (!isset($tableBody['Others'])) {
$tableBody['Others'] = array($row['label'], $row[$unique], 0);
$class['Others'] = 'wp-piwik-hideDetails';
$js['Others'] = '$j'."( '.wp-piwik-hideDetails' ).toggle( 'hidden' );";
$tableBody[$row['label']] = array($row['label'], $row[$unique], 0);
$class[$row['label']] = 'wp-piwik-hideDetails hidden';
$js[$row['label']] = '$j'."( '.wp-piwik-hideDetails' ).toggle( 'hidden' );";
} else {
$tableBody['Others'][1] += $row[$unique];
$tableBody[$row['label']] = array($row['label'], $row[$unique], 0);
$class[$row['label']] = 'wp-piwik-hideDetails hidden';
$js[$row['label']] = '$j'."( '.wp-piwik-hideDetails' ).toggle( 'hidden' );";
}
}
if ($count > $this->limit)
$tableBody['Others'][0] = __('Others', 'wp-piwik');
foreach ($tableBody as $key => $row)
$tableBody[$key][2] = number_format($row[1]/$sum*100, 2).'%';
if (!empty($tableBody)) $this->pieChart($tableBody);
$this->table($tableHead, $tableBody, null, false, $js, $class);
}
}
}

View File

@ -1,80 +0,0 @@
<?php
namespace WP_Piwik\Widget;
use WP_Piwik\Widget;
class Browsers extends Widget {
public $className = __CLASS__;
protected function configure($prefix = '', $params = array()) {
$timeSettings = $this->getTimeSettings();
$this->parameter = array(
'idSite' => self::$wpPiwik->getPiwikSiteId($this->blogId),
'period' => $timeSettings['period'],
'date' => $timeSettings['date']
);
$this->title = $prefix.__('Browsers', 'wp-piwik').' ('.__($timeSettings['description'],'wp-piwik').')';
$this->method = 'DevicesDetection.getBrowsers';
$this->context = 'normal';
wp_enqueue_script('wp-piwik', self::$wpPiwik->getPluginURL().'js/wp-piwik.js', array(), self::$wpPiwik->getPluginVersion(), true);
wp_enqueue_script('wp-piwik-jqplot',self::$wpPiwik->getPluginURL().'js/jqplot/wp-piwik.jqplot.js',array('jquery'));
wp_enqueue_style('wp-piwik', self::$wpPiwik->getPluginURL().'css/wp-piwik.css',array(),self::$wpPiwik->getPluginVersion());
add_action('admin_head-index.php', array($this, 'addHeaderLines'));
}
public function addHeaderLines() {
echo '<!--[if IE]><script language="javascript" type="text/javascript" src="'.self::$wpPiwik->getPluginURL().'js/jqplot/excanvas.min.js"></script><![endif]-->';
echo '<link rel="stylesheet" href="'.self::$wpPiwik->getPluginURL().'js/jqplot/jquery.jqplot.min.css" type="text/css"/>';
echo '<script type="text/javascript">var $j = jQuery.noConflict();</script>';
}
public function show() {
$response = self::$wpPiwik->request($this->apiID[$this->method]);
$tableBody = array();
if (!empty($response['result']) && $response['result'] ='error')
echo '<strong>'.__('Piwik error', 'wp-piwik').':</strong> '.htmlentities($response['message'], ENT_QUOTES, 'utf-8');
else {
$tableHead = array(__('Browser', 'wp-piwik'), __('Unique', 'wp-piwik'), __('Percent', 'wp-piwik'));
if (isset($response[0]['nb_uniq_visitors'])) $unique = 'nb_uniq_visitors';
else $unique = 'sum_daily_nb_uniq_visitors';
$count = 0;
$sum = 0;
$js = array();
$class = array();
if (is_array($response))
foreach ($response as $row) {
$count++;
$sum += isset($row[$unique])?$row[$unique]:0;
if ($count < $this->limit)
$tableBody[$row['label']] = array($row['label'], $row[$unique], 0);
elseif (!isset($tableBody['Others'])) {
$tableBody['Others'] = array($row['label'], $row[$unique], 0);
$class['Others'] = 'wp-piwik-hideDetails';
$js['Others'] = '$j'."( '.wp-piwik-hideDetails' ).toggle( 'hidden' );";
$tableBody[$row['label']] = array($row['label'], $row[$unique], 0);
$class[$row['label']] = 'wp-piwik-hideDetails hidden';
$js[$row['label']] = '$j'."( '.wp-piwik-hideDetails' ).toggle( 'hidden' );";
} else {
$tableBody['Others'][1] += $row[$unique];
$tableBody[$row['label']] = array($row['label'], $row[$unique], 0);
$class[$row['label']] = 'wp-piwik-hideDetails hidden';
$js[$row['label']] = '$j'."( '.wp-piwik-hideDetails' ).toggle( 'hidden' );";
}
}
if ($count > $this->limit)
$tableBody['Others'][0] = __('Others', 'wp-piwik');
elseif ($count == $this->limit) {
$class['Others'] = $js['Others'] = '';
}
foreach ($tableBody as $key => $row)
$tableBody[$key][2] = number_format($row[1]/$sum*100, 2).'%';
if (!empty($tableBody)) $this->pieChart($tableBody);
$this->table($tableHead, $tableBody, null, false, $js, $class);
}
}
}

View File

@ -1,78 +0,0 @@
<?php
namespace WP_Piwik\Widget;
use WP_Piwik\Widget;
class Chart extends Widget {
public $className = __CLASS__;
protected function configure($prefix = '', $params = array()) {
$timeSettings = $this->getTimeSettings();
$this->parameter = array(
'idSite' => self::$wpPiwik->getPiwikSiteId($this->blogId),
'period' => isset($params['period'])?$params['period']:$timeSettings['period'],
'date' => 'last'.($timeSettings['period']=='day'?'30':'12'),
'limit' => null
);
$this->title = $prefix.__('Visitors', 'wp-piwik').' ('.__($this->rangeName(),'wp-piwik').')';
$this->method = array('VisitsSummary.getVisits', 'VisitsSummary.getUniqueVisitors', 'VisitsSummary.getBounceCount', 'VisitsSummary.getActions');
$this->context = 'normal';
wp_enqueue_script('wp-piwik', self::$wpPiwik->getPluginURL().'js/wp-piwik.js', array(), self::$wpPiwik->getPluginVersion(), true);
wp_enqueue_script('wp-piwik-jqplot',self::$wpPiwik->getPluginURL().'js/jqplot/wp-piwik.jqplot.js',array('jquery'));
wp_enqueue_style('wp-piwik', self::$wpPiwik->getPluginURL().'css/wp-piwik.css',array(),self::$wpPiwik->getPluginVersion());
add_action('admin_head-index.php', array($this, 'addHeaderLines'));
}
public function addHeaderLines() {
echo '<!--[if IE]><script language="javascript" type="text/javascript" src="'.self::$wpPiwik->getPluginURL().'js/jqplot/excanvas.min.js"></script><![endif]-->';
echo '<link rel="stylesheet" href="'.self::$wpPiwik->getPluginURL().'js/jqplot/jquery.jqplot.min.css" type="text/css"/>';
echo '<script type="text/javascript">var $j = jQuery.noConflict();</script>';
}
public function show() {
$response = array();
$success = true;
foreach ($this->method as $method) {
$response[$method] = self::$wpPiwik->request($this->apiID[$method]);
if (!empty($response[$method]['result']) && $response[$method]['result'] ='error')
$success = false;
}
if (!$success)
echo '<strong>'.__('Piwik error', 'wp-piwik').':</strong> '.htmlentities($response[$method]['message'], ENT_QUOTES, 'utf-8');
else {
$values = $labels = $bounced = $unique = '';
$count = $uniqueSum = 0;
if (is_array($response['VisitsSummary.getVisits']))
foreach ($response['VisitsSummary.getVisits'] as $date => $value) {
$count++;
$values .= $value.',';
$unique .= $response['VisitsSummary.getUniqueVisitors'][$date].',';
$bounced .= $response['VisitsSummary.getBounceCount'][$date].',';
if ($this->parameter['period'] == 'week') {
preg_match("/[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])/", $date, $dateList);
$textKey = $this->dateFormat($dateList[0], 'short_week');
} else $textKey = substr($date, -2);
$labels .= '['.$count.',"'.$textKey.'"],';
$uniqueSum += $response['VisitsSummary.getActions'][$date];
}
else {
$values = '0,';
$labels = '[0,"-"],';
$unique = '0,';
$bounced = '0,';
}
$average = round($uniqueSum/30,0);
$values = substr($values, 0, -1);
$unique = substr($unique, 0, -1);
$labels = substr($labels, 0, -1);
$bounced = substr($bounced, 0, -1);
echo '<div id="wp-piwik_stats_vistors_graph" style="height:220px;" title="'.__('The graph contains the values shown in the table below (visitors / unique / bounces). The red line shows a linear trendline (unique).', 'wp-piwik').'"></div>';
echo '<script type="text/javascript">';
echo '$j.jqplot("wp-piwik_stats_vistors_graph", [['.$values.'],['.$unique.'],['.$bounced.']],{axes:{yaxis:{min:0, tickOptions:{formatString:"%.0f"}},xaxis:{min:1,max:30,ticks:['.$labels.']}},seriesDefaults:{showMarker:false,lineWidth:1,fill:true,fillAndStroke:true,fillAlpha:0.9,trendline:{show:false,color:"#C00",lineWidth:1.5,type:"exp"}},series:[{color:"#90AAD9",fillColor:"#D4E2ED"},{color:"#A3BCEA",fillColor:"#E4F2FD",trendline:{show:true,label:"Unique visitor trend"}},{color:"#E9A0BA",fillColor:"#FDE4F2"}],});';
echo '</script>';
}
}
}

View File

@ -1,80 +0,0 @@
<?php
namespace WP_Piwik\Widget;
use WP_Piwik\Widget;
class City extends Widget {
public $className = __CLASS__;
protected function configure($prefix = '', $params = array()) {
$timeSettings = $this->getTimeSettings();
$this->parameter = array(
'idSite' => self::$wpPiwik->getPiwikSiteId($this->blogId),
'period' => $timeSettings['period'],
'date' => $timeSettings['date']
);
$this->title = $prefix.__('Countries', 'wp-piwik').' ('.__($timeSettings['description'],'wp-piwik').')';
$this->method = 'UserCountry.getCity';
$this->context = 'normal';
wp_enqueue_script('wp-piwik', self::$wpPiwik->getPluginURL().'js/wp-piwik.js', array(), self::$wpPiwik->getPluginVersion(), true);
wp_enqueue_script('wp-piwik-jqplot',self::$wpPiwik->getPluginURL().'js/jqplot/wp-piwik.jqplot.js',array('jquery'));
wp_enqueue_style('wp-piwik', self::$wpPiwik->getPluginURL().'css/wp-piwik.css',array(),self::$wpPiwik->getPluginVersion());
add_action('admin_head-index.php', array($this, 'addHeaderLines'));
}
public function addHeaderLines() {
echo '<!--[if IE]><script language="javascript" type="text/javascript" src="'.self::$wpPiwik->getPluginURL().'js/jqplot/excanvas.min.js"></script><![endif]-->';
echo '<link rel="stylesheet" href="'.self::$wpPiwik->getPluginURL().'js/jqplot/jquery.jqplot.min.css" type="text/css"/>';
echo '<script type="text/javascript">var $j = jQuery.noConflict();</script>';
}
public function show() {
$response = self::$wpPiwik->request($this->apiID[$this->method]);
$tableBody = array();
if (!empty($response['result']) && $response['result'] ='error')
echo '<strong>'.__('Piwik error', 'wp-piwik').':</strong> '.htmlentities($response['message'], ENT_QUOTES, 'utf-8');
else {
$tableHead = array(__('City', 'wp-piwik'), __('Unique', 'wp-piwik'), __('Percent', 'wp-piwik'));
if (isset($response[0]['nb_uniq_visitors'])) $unique = 'nb_uniq_visitors';
else $unique = 'sum_daily_nb_uniq_visitors';
$count = 0;
$sum = 0;
$js = array();
$class = array();
if (is_array($response))
foreach ($response as $row) {
$count++;
$sum += isset($row[$unique])?$row[$unique]:0;
if ($count < $this->limit)
$tableBody[$row['label']] = array($row['label'], $row[$unique], 0);
elseif (!isset($tableBody['Others'])) {
$tableBody['Others'] = array($row['label'], $row[$unique], 0);
$class['Others'] = 'wp-piwik-hideDetails';
$js['Others'] = '$j'."( '.wp-piwik-hideDetails' ).toggle( 'hidden' );";
$tableBody[$row['label']] = array($row['label'], $row[$unique], 0);
$class[$row['label']] = 'wp-piwik-hideDetails hidden';
$js[$row['label']] = '$j'."( '.wp-piwik-hideDetails' ).toggle( 'hidden' );";
} else {
$tableBody['Others'][1] += $row[$unique];
$tableBody[$row['label']] = array($row['label'], $row[$unique], 0);
$class[$row['label']] = 'wp-piwik-hideDetails hidden';
$js[$row['label']] = '$j'."( '.wp-piwik-hideDetails' ).toggle( 'hidden' );";
}
}
if ($count > $this->limit)
$tableBody['Others'][0] = __('Others', 'wp-piwik');
elseif ($count == $this->limit) {
$class['Others'] = $js['Others'] = '';
}
foreach ($tableBody as $key => $row)
$tableBody[$key][2] = number_format($row[1]/$sum*100, 2).'%';
if (!empty($tableBody)) $this->pieChart($tableBody);
$this->table($tableHead, $tableBody, null, false, $js, $class);
}
}
}

View File

@ -1,80 +0,0 @@
<?php
namespace WP_Piwik\Widget;
use WP_Piwik\Widget;
class Country extends Widget {
public $className = __CLASS__;
protected function configure($prefix = '', $params = array()) {
$timeSettings = $this->getTimeSettings();
$this->parameter = array(
'idSite' => self::$wpPiwik->getPiwikSiteId($this->blogId),
'period' => $timeSettings['period'],
'date' => $timeSettings['date']
);
$this->title = $prefix.__('Countries', 'wp-piwik').' ('.__($timeSettings['description'],'wp-piwik').')';
$this->method = 'UserCountry.getCountry ';
$this->context = 'normal';
wp_enqueue_script('wp-piwik', self::$wpPiwik->getPluginURL().'js/wp-piwik.js', array(), self::$wpPiwik->getPluginVersion(), true);
wp_enqueue_script('wp-piwik-jqplot',self::$wpPiwik->getPluginURL().'js/jqplot/wp-piwik.jqplot.js',array('jquery'));
wp_enqueue_style('wp-piwik', self::$wpPiwik->getPluginURL().'css/wp-piwik.css',array(),self::$wpPiwik->getPluginVersion());
add_action('admin_head-index.php', array($this, 'addHeaderLines'));
}
public function addHeaderLines() {
echo '<!--[if IE]><script language="javascript" type="text/javascript" src="'.self::$wpPiwik->getPluginURL().'js/jqplot/excanvas.min.js"></script><![endif]-->';
echo '<link rel="stylesheet" href="'.self::$wpPiwik->getPluginURL().'js/jqplot/jquery.jqplot.min.css" type="text/css"/>';
echo '<script type="text/javascript">var $j = jQuery.noConflict();</script>';
}
public function show() {
$response = self::$wpPiwik->request($this->apiID[$this->method]);
$tableBody = array();
if (!empty($response['result']) && $response['result'] ='error')
echo '<strong>'.__('Piwik error', 'wp-piwik').':</strong> '.htmlentities($response['message'], ENT_QUOTES, 'utf-8');
else {
$tableHead = array(__('Country', 'wp-piwik'), __('Unique', 'wp-piwik'), __('Percent', 'wp-piwik'));
if (isset($response[0]['nb_uniq_visitors'])) $unique = 'nb_uniq_visitors';
else $unique = 'sum_daily_nb_uniq_visitors';
$count = 0;
$sum = 0;
$js = array();
$class = array();
if (is_array($response))
foreach ($response as $row) {
$count++;
$sum += isset($row[$unique])?$row[$unique]:0;
if ($count < $this->limit)
$tableBody[$row['label']] = array($row['label'], $row[$unique], 0);
elseif (!isset($tableBody['Others'])) {
$tableBody['Others'] = array($row['label'], $row[$unique], 0);
$class['Others'] = 'wp-piwik-hideDetails';
$js['Others'] = '$j'."( '.wp-piwik-hideDetails' ).toggle( 'hidden' );";
$tableBody[$row['label']] = array($row['label'], $row[$unique], 0);
$class[$row['label']] = 'wp-piwik-hideDetails hidden';
$js[$row['label']] = '$j'."( '.wp-piwik-hideDetails' ).toggle( 'hidden' );";
} else {
$tableBody['Others'][1] += $row[$unique];
$tableBody[$row['label']] = array($row['label'], $row[$unique], 0);
$class[$row['label']] = 'wp-piwik-hideDetails hidden';
$js[$row['label']] = '$j'."( '.wp-piwik-hideDetails' ).toggle( 'hidden' );";
}
}
if ($count > $this->limit)
$tableBody['Others'][0] = __('Others', 'wp-piwik');
elseif ($count == $this->limit) {
$class['Others'] = $js['Others'] = '';
}
foreach ($tableBody as $key => $row)
$tableBody[$key][2] = number_format($row[1]/$sum*100, 2).'%';
if (!empty($tableBody)) $this->pieChart($tableBody);
$this->table($tableHead, $tableBody, null, false, $js, $class);
}
}
}

View File

@ -1,45 +0,0 @@
<?php
namespace WP_Piwik\Widget;
class Ecommerce extends \WP_Piwik\Widget {
public $className = __CLASS__;
protected function configure($prefix = '', $params = array()) {
$timeSettings = $this->getTimeSettings();
$this->title = $prefix.__('E-Commerce', 'wp-piwik');
$this->method = 'Goals.get';
$this->parameter = array(
'idSite' => self::$wpPiwik->getPiwikSiteId($this->blogId),
'period' => $timeSettings['period'],
'date' => $timeSettings['date']
);
}
public function show() {
$response = self::$wpPiwik->request($this->apiID[$this->method]);
if (!empty($response['result']) && $response['result'] ='error')
echo '<strong>'.__('Piwik error', 'wp-piwik').':</strong> '.htmlentities($response['message'], ENT_QUOTES, 'utf-8');
else {
$tableHead = null;
$tableBody = array(
array(__('Conversions', 'wp-piwik').':', $this->value($response, 'nb_conversions')),
array(__('Visits converted', 'wp-piwik').':', $this->value($response, 'nb_visits_converted')),
array(__('Revenue', 'wp-piwik').':', number_format($this->value($response, 'revenue'),2)),
array(__('Conversion rate', 'wp-piwik').':', $this->value($response, 'conversion_rate')),
array(__('Conversions (new visitor)', 'wp-piwik').':', $this->value($response, 'nb_conversions_new_visit')),
array(__('Visits converted (new visitor)', 'wp-piwik').':', $this->value($response, 'nb_visits_converted_new_visit')),
array(__('Revenue (new visitor)', 'wp-piwik').':', number_format($this->value($response, 'revenue_new_visit'),2)),
array(__('Conversion rate (new visitor)', 'wp-piwik').':', $this->value($response, 'conversion_rate_new_visit')),
array(__('Conversions (returning visitor)', 'wp-piwik').':', $this->value($response, 'nb_conversions_returning_visit')),
array(__('Visits converted (returning visitor)', 'wp-piwik').':', $this->value($response, 'nb_visits_converted_returning_visit')),
array(__('Revenue (returning visitor)', 'wp-piwik').':', number_format($this->value($response, 'revenue_returning_visit'),2)),
array(__('Conversion rate (returning visitor)', 'wp-piwik').':', $this->value($response, 'conversion_rate_returning_visit')),
);
$tableFoot = (self::$settings->getGlobalOption('piwik_shortcut')?array(__('Shortcut', 'wp-piwik').':', '<a href="'.self::$settings->getGlobalOption('piwik_url').'">Piwik</a>'.(isset($aryConf['inline']) && $aryConf['inline']?' - <a href="?page=wp-piwik_stats">WP-Piwik</a>':'')):null);
$this->table($tableHead, $tableBody, $tableFoot);
}
}
}

View File

@ -1,52 +0,0 @@
<?php
namespace WP_Piwik\Widget;
class Items extends \WP_Piwik\Widget {
public $className = __CLASS__;
protected function configure($prefix = '', $params = array()) {
$timeSettings = $this->getTimeSettings();
$this->title = $prefix.__('E-Commerce Items', 'wp-piwik');
$this->method = 'Goals.getItemsName';
$this->parameter = array(
'idSite' => self::$wpPiwik->getPiwikSiteId($this->blogId),
'period' => $timeSettings['period'],
'date' => $timeSettings['date']
);
}
public function show() {
$response = self::$wpPiwik->request($this->apiID[$this->method]);
if (!empty($response['result']) && $response['result'] ='error')
echo '<strong>'.__('Piwik error', 'wp-piwik').':</strong> '.htmlentities($response['message'], ENT_QUOTES, 'utf-8');
else {
$tableHead = array(
__('Label', 'wp-piwik'),
__('Revenue', 'wp-piwik'),
__('Quantity', 'wp-piwik'),
__('Orders', 'wp-piwik'),
__('Avg. price', 'wp-piwik'),
__('Avg. quantity', 'wp-piwik'),
__('Conversion rate', 'wp-piwik'),
);
$tableBody = array();
if (is_array($response))
foreach ($response as $data) {
array_push($tableBody, array(
$data['label'],
number_format($data['revenue'],2),
$data['quantity'],
$data['orders'],
number_format($data['avg_price'],2),
$data['avg_quantity'],
$data['conversion_rate']
));
}
$tableFoot = array();
$this->table($tableHead, $tableBody, $tableFoot);
}
}
}

View File

@ -1,52 +0,0 @@
<?php
namespace WP_Piwik\Widget;
class ItemsCategory extends \WP_Piwik\Widget {
public $className = __CLASS__;
protected function configure($prefix = '', $params = array()) {
$timeSettings = $this->getTimeSettings();
$this->title = $prefix.__('E-Commerce Item Categories', 'wp-piwik');
$this->method = 'Goals.getItemsCategory';
$this->parameter = array(
'idSite' => self::$wpPiwik->getPiwikSiteId($this->blogId),
'period' => $timeSettings['period'],
'date' => $timeSettings['date']
);
}
public function show() {
$response = self::$wpPiwik->request($this->apiID[$this->method]);
if (!empty($response['result']) && $response['result'] ='error')
echo '<strong>'.__('Piwik error', 'wp-piwik').':</strong> '.htmlentities($response['message'], ENT_QUOTES, 'utf-8');
else {
$tableHead = array(
__('Label', 'wp-piwik'),
__('Revenue', 'wp-piwik'),
__('Quantity', 'wp-piwik'),
__('Orders', 'wp-piwik'),
__('Avg. price', 'wp-piwik'),
__('Avg. quantity', 'wp-piwik'),
__('Conversion rate', 'wp-piwik'),
);
$tableBody = array();
if (is_array($response))
foreach ($response as $data) {
array_push($tableBody, array(
$data['label'],
isset($data['revenue'])?number_format($data['revenue'],2):"-.--",
isset($data['quantity'])?$data['quantity']:'-',
isset($data['orders'])?$data['orders']:'-',
number_format($data['avg_price'],2),
$data['avg_quantity'],
$data['conversion_rate']
));
}
$tableFoot = array();
$this->table($tableHead, $tableBody, $tableFoot);
}
}
}

View File

@ -1,21 +0,0 @@
<?php
namespace WP_Piwik\Widget;
class Keywords extends \WP_Piwik\Widget {
public $className = __CLASS__;
protected function configure($prefix = '', $params = array()) {
$timeSettings = $this->getTimeSettings();
$this->parameter = array(
'idSite' => self::$wpPiwik->getPiwikSiteId($this->blogId),
'period' => $timeSettings['period'],
'date' => $timeSettings['date']
);
$this->title = $prefix.__('Keywords', 'wp-piwik').' ('.__($timeSettings['description'],'wp-piwik').')';
$this->method = 'Referrers.getKeywords';
$this->name = 'Keyword';
}
}

View File

@ -1,80 +0,0 @@
<?php
namespace WP_Piwik\Widget;
use WP_Piwik\Widget;
class Models extends Widget {
public $className = __CLASS__;
protected function configure($prefix = '', $params = array()) {
$timeSettings = $this->getTimeSettings();
$this->parameter = array(
'idSite' => self::$wpPiwik->getPiwikSiteId($this->blogId),
'period' => $timeSettings['period'],
'date' => $timeSettings['date']
);
$this->title = $prefix.__('Models', 'wp-piwik').' ('.__($timeSettings['description'],'wp-piwik').')';
$this->method = 'DevicesDetection.getModel';
$this->context = 'normal';
wp_enqueue_script('wp-piwik', self::$wpPiwik->getPluginURL().'js/wp-piwik.js', array(), self::$wpPiwik->getPluginVersion(), true);
wp_enqueue_script('wp-piwik-jqplot',self::$wpPiwik->getPluginURL().'js/jqplot/wp-piwik.jqplot.js',array('jquery'));
wp_enqueue_style('wp-piwik', self::$wpPiwik->getPluginURL().'css/wp-piwik.css',array(),self::$wpPiwik->getPluginVersion());
add_action('admin_head-index.php', array($this, 'addHeaderLines'));
}
public function addHeaderLines() {
echo '<!--[if IE]><script language="javascript" type="text/javascript" src="'.self::$wpPiwik->getPluginURL().'js/jqplot/excanvas.min.js"></script><![endif]-->';
echo '<link rel="stylesheet" href="'.self::$wpPiwik->getPluginURL().'js/jqplot/jquery.jqplot.min.css" type="text/css"/>';
echo '<script type="text/javascript">var $j = jQuery.noConflict();</script>';
}
public function show() {
$response = self::$wpPiwik->request($this->apiID[$this->method]);
$tableBody = array();
if (!empty($response['result']) && $response['result'] ='error')
echo '<strong>'.__('Piwik error', 'wp-piwik').':</strong> '.htmlentities($response['message'], ENT_QUOTES, 'utf-8');
else {
$tableHead = array(__('Model', 'wp-piwik'), __('Unique', 'wp-piwik'), __('Percent', 'wp-piwik'));
if (isset($response[0]['nb_uniq_visitors'])) $unique = 'nb_uniq_visitors';
else $unique = 'sum_daily_nb_uniq_visitors';
$count = 0;
$sum = 0;
$js = array();
$class = array();
if (is_array($response))
foreach ($response as $row) {
$count++;
$sum += isset($row[$unique])?$row[$unique]:0;
if ($count < $this->limit)
$tableBody[$row['label']] = array($row['label'], $row[$unique], 0);
elseif (!isset($tableBody['Others'])) {
$tableBody['Others'] = array($row['label'], $row[$unique], 0);
$class['Others'] = 'wp-piwik-hideDetails';
$js['Others'] = '$j'."( '.wp-piwik-hideDetails' ).toggle( 'hidden' );";
$tableBody[$row['label']] = array($row['label'], $row[$unique], 0);
$class[$row['label']] = 'wp-piwik-hideDetails hidden';
$js[$row['label']] = '$j'."( '.wp-piwik-hideDetails' ).toggle( 'hidden' );";
} else {
$tableBody['Others'][1] += $row[$unique];
$tableBody[$row['label']] = array($row['label'], $row[$unique], 0);
$class[$row['label']] = 'wp-piwik-hideDetails hidden';
$js[$row['label']] = '$j'."( '.wp-piwik-hideDetails' ).toggle( 'hidden' );";
}
}
if ($count > $this->limit)
$tableBody['Others'][0] = __('Others', 'wp-piwik');
elseif ($count == $this->limit) {
$class['Others'] = $js['Others'] = '';
}
foreach ($tableBody as $key => $row)
$tableBody[$key][2] = number_format($row[1]/$sum*100, 2).'%';
if (!empty($tableBody)) $this->pieChart($tableBody);
$this->table($tableHead, $tableBody, null, false, $js, $class);
}
}
}

View File

@ -1,38 +0,0 @@
<?php
namespace WP_Piwik\Widget;
class Noresult extends \WP_Piwik\Widget {
public $className = __CLASS__;
protected function configure($prefix = '', $params = array()) {
$timeSettings = $this->getTimeSettings();
$this->parameter = array(
'idSite' => self::$wpPiwik->getPiwikSiteId($this->blogId),
'period' => $timeSettings['period'],
'date' => $timeSettings['date']
);
$this->title = $prefix.__('Site Search', 'wp-piwik').' ('.__($timeSettings['description'],'wp-piwik').')';
$this->method = 'Actions.getSiteSearchNoResultKeywords';
}
public function show() {
$response = self::$wpPiwik->request($this->apiID[$this->method]);
if (!empty($response['result']) && $response['result'] ='error')
echo '<strong>'.__('Piwik error', 'wp-piwik').':</strong> '.htmlentities($response['message'], ENT_QUOTES, 'utf-8');
else {
$tableHead = array(__('Keyword', 'wp-piwik'), __('Requests', 'wp-piwik'), __('Bounced', 'wp-piwik'));
$tableBody = array();
$count = 0;
if (is_array($response))
foreach ($response as $row) {
$count++;
$tableBody[] = array($row['label'], $row['nb_visits'], $row['bounce_rate']);
if ($count == 10) break;
}
$this->table($tableHead, $tableBody, null);
}
}
}

View File

@ -1,31 +0,0 @@
<?php
namespace WP_Piwik\Widget;
class OptOut extends \WP_Piwik\Widget {
public $className = __CLASS__;
protected function configure($prefix = '', $params = array()) {
$this->parameter = $params;
}
public function show() {
$protocol = (isset ( $_SERVER ['HTTPS'] ) && $_SERVER ['HTTPS'] != 'off') ? 'https' : 'http';
switch (self::$settings->getGlobalOption ( 'piwik_mode' )) {
case 'php' :
$PIWIK_URL = $protocol . ':' . self::$settings->getGlobalOption ( 'proxy_url' );
break;
case 'cloud' :
$PIWIK_URL = 'https://' . self::$settings->getGlobalOption ( 'piwik_user' ) . '.innocraft.cloud/';
break;
case 'cloud-matomo':
$PIWIK_URL = 'https://' . self::$settings->getGlobalOption ( 'matomo_user' ) . '.matomo.cloud/';
break;
default :
$PIWIK_URL = self::$settings->getGlobalOption ( 'piwik_url' );
}
$this->out ( '<iframe frameborder="no" width="'.(isset($this->parameter['width'])?$this->parameter['width']:'').'" height="'.(isset($this->parameter['height'])?$this->parameter['height']:'').'" src="'.$PIWIK_URL.'index.php?module=CoreAdminHome&action=optOut&'.(isset($this->parameter['idsite'])?'idsite='.$this->parameter['idsite'].'&':'').'language='.(isset($this->parameter['language'])?$this->parameter['language']:'en').'"></iframe>' );
}
}

View File

@ -1,63 +0,0 @@
<?php
namespace WP_Piwik\Widget;
class Overview extends \WP_Piwik\Widget {
public $className = __CLASS__;
protected function configure($prefix = '', $params = array()) {
$timeSettings = $this->getTimeSettings();
$this->parameter = array(
'idSite' => self::$wpPiwik->getPiwikSiteId($this->blogId),
'period' => isset($params['period'])?$params['period']:$timeSettings['period'],
'date' => isset($params['date'])?$params['date']: $timeSettings['date'],
'description' => $timeSettings['description']
);
$this->title = !$this->isShortcode?$prefix.__('Overview', 'wp-piwik').' ('.__($this->pageId == 'dashboard'?$this->rangeName():$timeSettings['description'],'wp-piwik').')':($params['title']?$params['title']:'');
$this->method = 'VisitsSummary.get';
}
public function show() {
$response = self::$wpPiwik->request($this->apiID[$this->method]);
if (!empty($response['result']) && $response['result'] ='error')
echo '<strong>'.__('Piwik error', 'wp-piwik').':</strong> '.htmlentities($response['message'], ENT_QUOTES, 'utf-8');
else {
if ($this->parameter['date'] == 'last30') {
$result = array();
if (is_array($response)) {
foreach ($response as $data)
foreach ($data as $key => $value)
if (isset($result[$key]) && is_numeric($value))
$result[$key] += $value;
elseif (is_numeric($value))
$result[$key] = $value;
else
$result[$key] = 0;
if (isset($result['nb_visits']) && $result['nb_visits'] > 0) {
$result['nb_actions_per_visit'] = round($result['nb_actions'] / $result['nb_visits'], 1);
$result['bounce_rate'] = round($result['bounce_count'] / $result['nb_visits'] * 100, 1) . '%';
$result['avg_time_on_site'] = round($result['sum_visit_length'] / $result['nb_visits'], 0);
} else $result['nb_actions_per_visit'] = $result['bounce_rate'] = $result['avg_time_on_site'] = 0;
}
$response = $result;
}
$time = isset($response['sum_visit_length'])?$this->timeFormat($response['sum_visit_length']):'-';
$avgTime = isset($response['avg_time_on_site'])?$this->timeFormat($response['avg_time_on_site']):'-';
$tableHead = null;
$tableBody = array(array(__('Visitors', 'wp-piwik').':', $this->value($response, 'nb_visits')));
if ($this->value($response, 'nb_uniq_visitors') != '-')
array_push($tableBody, array(__('Unique visitors', 'wp-piwik').':', $this->value($response, 'nb_uniq_visitors')));
array_push($tableBody,
array(__('Page views', 'wp-piwik').':', $this->value($response, 'nb_actions').' (&#216; '.$this->value($response, 'nb_actions_per_visit').')'),
array(__('Total time spent', 'wp-piwik').':', $time.' (&#216; '.$avgTime.')'),
array(__('Bounce count', 'wp-piwik').':', $this->value($response, 'bounce_count').' ('.$this->value($response, 'bounce_rate').')')
);
if ($this->parameter['date'] != 'last30')
array_push($tableBody, array(__('Time/visit', 'wp-piwik').':', $avgTime), array(__('Max. page views in one visit', 'wp-piwik').':', $this->value($response, 'max_actions')));
$tableFoot = (self::$settings->getGlobalOption('piwik_shortcut')?array(__('Shortcut', 'wp-piwik').':', '<a href="'.self::$settings->getGlobalOption('piwik_url').'">Piwik</a>'.(isset($aryConf['inline']) && $aryConf['inline']?' - <a href="?page=wp-piwik_stats">WP-Piwik</a>':'')):null);
$this->table($tableHead, $tableBody, $tableFoot);
}
}
}

View File

@ -1,21 +0,0 @@
<?php
namespace WP_Piwik\Widget;
class Pages extends \WP_Piwik\Widget {
public $className = __CLASS__;
protected function configure($prefix = '', $params = array()) {
$timeSettings = $this->getTimeSettings();
$this->parameter = array(
'idSite' => self::$wpPiwik->getPiwikSiteId($this->blogId),
'period' => $timeSettings['period'],
'date' => $timeSettings['date']
);
$this->title = $prefix.__('Pages', 'wp-piwik').' ('.__($timeSettings['description'],'wp-piwik').')';
$this->method = 'Actions.getPageTitles';
$this->name = __('Page', 'wp-piwik' );
}
}

View File

@ -1,38 +0,0 @@
<?php
namespace WP_Piwik\Widget;
class Plugins extends \WP_Piwik\Widget {
public $className = __CLASS__;
protected function configure($prefix = '', $params = array()) {
$timeSettings = $this->getTimeSettings();
$this->parameter = array(
'idSite' => self::$wpPiwik->getPiwikSiteId($this->blogId),
'period' => $timeSettings['period'],
'date' => $timeSettings['date']
);
$this->title = $prefix.__('Plugins', 'wp-piwik').' ('.__($timeSettings['description'],'wp-piwik').')';
$this->method = 'DevicePlugins.getPlugin';
}
public function show() {
$response = self::$wpPiwik->request($this->apiID[$this->method]);
if (!empty($response['result']) && $response['result'] ='error')
echo '<strong>'.__('Piwik error', 'wp-piwik').':</strong> '.htmlentities($response['message'], ENT_QUOTES, 'utf-8');
else {
$tableHead = array(__('Plugin', 'wp-piwik'), __('Visits', 'wp-piwik'), __('Percent', 'wp-piwik'));
$tableBody = array();
$count = 0;
if (is_array($response))
foreach ($response as $row) {
$count++;
$tableBody[] = array($row['label'], $row['nb_visits'], $row['nb_visits_percentage']);
if ($count == 10) break;
}
$this->table($tableHead, $tableBody, null);
}
}
}

View File

@ -1,51 +0,0 @@
<?php
namespace WP_Piwik\Widget;
class Post extends \WP_Piwik\Widget {
public $className = __CLASS__;
protected function configure($prefix = '', $params = array()) {
global $post;
$this->parameter = array(
'idSite' => self::$wpPiwik->getPiwikSiteId($this->blogId),
'period' => 'range',
'date' => isset($params['range'])?$params['range']:'last30',
'key' => isset($params['key'])?$params['key']:null,
'pageUrl' => isset($params['url'])?$params['url']:urlencode(get_permalink($post->ID)),
);
$this->title = $prefix.__('Overview', 'wp-piwik').' ('.__($this->parameter['date'],'wp-piwik').')';
$this->method = 'Actions.getPageUrl';
}
public function show() {
$response = self::$wpPiwik->request($this->apiID[$this->method]);
if (!empty($response['result']) && $response['result'] ='error')
echo '<strong>'.__('Piwik error', 'wp-piwik').':</strong> '.htmlentities($response['message'], ENT_QUOTES, 'utf-8');
else {
if (isset($response[0]))
$response = $response[0];
if ($this->parameter['key']) {
$this->out(isset($response[$this->parameter['key']])?$response[$this->parameter['key']]:'<em>not defined</em>');
return;
}
$time = isset($response['entry_sum_visit_length'])?$this->timeFormat($response['entry_sum_visit_length']):'-';
$avgTime = isset($response['avg_time_on_page'])?$this->timeFormat($response['avg_time_on_page']):'-';
$tableHead = null;
$tableBody = array(
array(__('Visitors', 'wp-piwik').':', $this->value($response, 'nb_visits')),
array(__('Unique visitors', 'wp-piwik').':', $this->value($response, 'sum_daily_nb_uniq_visitors')),
array(__('Page views', 'wp-piwik').':', $this->value($response, 'nb_hits').' (&#216; '.$this->value($response, 'entry_nb_actions').')'),
array(__('Total time spent', 'wp-piwik').':', $time),
array(__('Time/visit', 'wp-piwik').':', $avgTime),
array(__('Bounce count', 'wp-piwik').':', $this->value($response, 'entry_bounce_count').' ('.$this->value($response, 'bounce_rate').')'),
array(__('Min. generation time', 'wp-piwik').':', $this->value($response, 'min_time_generation')),
array(__('Max. generation time', 'wp-piwik').':', $this->value($response, 'max_time_generation'))
);
$tableFoot = (self::$settings->getGlobalOption('piwik_shortcut')?array(__('Shortcut', 'wp-piwik').':', '<a href="'.self::$settings->getGlobalOption('piwik_url').'">Piwik</a>'.(isset($aryConf['inline']) && $aryConf['inline']?' - <a href="?page=wp-piwik_stats">WP-Piwik</a>':'')):null);
$this->table($tableHead, $tableBody, $tableFoot);
}
}
}

View File

@ -1,21 +0,0 @@
<?php
namespace WP_Piwik\Widget;
class Referrers extends \WP_Piwik\Widget {
public $className = __CLASS__;
protected function configure($prefix = '', $params = array()) {
$timeSettings = $this->getTimeSettings();
$this->parameter = array(
'idSite' => self::$wpPiwik->getPiwikSiteId($this->blogId),
'period' => $timeSettings['period'],
'date' => $timeSettings['date']
);
$this->title = $prefix.__('Referrers', 'wp-piwik').' ('.__($timeSettings['description'],'wp-piwik').')';
$this->method = 'Referrers.getWebsites';
$this->name = 'Referrer';
}
}

View File

@ -1,75 +0,0 @@
<?php
namespace WP_Piwik\Widget;
class Screens extends \WP_Piwik\Widget {
public $className = __CLASS__;
protected function configure($prefix = '', $params = array()) {
$timeSettings = $this->getTimeSettings();
$this->parameter = array(
'idSite' => self::$wpPiwik->getPiwikSiteId($this->blogId),
'period' => $timeSettings['period'],
'date' => $timeSettings['date']
);
$this->title = $prefix.__('Resolutions', 'wp-piwik').' ('.__($timeSettings['description'],'wp-piwik').')';
$this->method = 'Resolution.getResolution';
$this->context = 'normal';
wp_enqueue_script('wp-piwik', self::$wpPiwik->getPluginURL().'js/wp-piwik.js', array(), self::$wpPiwik->getPluginVersion(), true);
wp_enqueue_script('wp-piwik-jqplot',self::$wpPiwik->getPluginURL().'js/jqplot/wp-piwik.jqplot.js',array('jquery'));
wp_enqueue_style('wp-piwik', self::$wpPiwik->getPluginURL().'css/wp-piwik.css',array(),self::$wpPiwik->getPluginVersion());
add_action('admin_head-index.php', array($this, 'addHeaderLines'));
}
public function addHeaderLines() {
echo '<!--[if IE]><script language="javascript" type="text/javascript" src="'.self::$wpPiwik->getPluginURL().'js/jqplot/excanvas.min.js"></script><![endif]-->';
echo '<link rel="stylesheet" href="'.self::$wpPiwik->getPluginURL().'js/jqplot/jquery.jqplot.min.css" type="text/css"/>';
echo '<script type="text/javascript">var $j = jQuery.noConflict();</script>';
}
public function show() {
$response = self::$wpPiwik->request($this->apiID[$this->method]);
$tableBody = array();
if (!empty($response['result']) && $response['result'] ='error')
echo '<strong>'.__('Piwik error', 'wp-piwik').':</strong> '.htmlentities($response['message'], ENT_QUOTES, 'utf-8');
else {
$tableHead = array(__('Resolution', 'wp-piwik'), __('Unique', 'wp-piwik'), __('Percent', 'wp-piwik'));
if (isset($response[0]['nb_uniq_visitors'])) $unique = 'nb_uniq_visitors';
else $unique = 'sum_daily_nb_uniq_visitors';
$count = 0;
$sum = 0;
$js = array();
$class = array();
if (is_array($response))
foreach ($response as $row) {
$count++;
$sum += isset($row[$unique])?$row[$unique]:0;
if ($count < $this->limit)
$tableBody[$row['label']] = array($row['label'], $row[$unique], 0);
elseif (!isset($tableBody['Others'])) {
$tableBody['Others'] = array($row['label'], $row[$unique], 0);
$class['Others'] = 'wp-piwik-hideDetails';
$js['Others'] = '$j'."( '.wp-piwik-hideDetails' ).toggle( 'hidden' );";
$tableBody[$row['label']] = array($row['label'], $row[$unique], 0);
$class[$row['label']] = 'wp-piwik-hideDetails hidden';
$js[$row['label']] = '$j'."( '.wp-piwik-hideDetails' ).toggle( 'hidden' );";
} else {
$tableBody['Others'][1] += $row[$unique];
$tableBody[$row['label']] = array($row['label'], $row[$unique], 0);
$class[$row['label']] = 'wp-piwik-hideDetails hidden';
$js[$row['label']] = '$j'."( '.wp-piwik-hideDetails' ).toggle( 'hidden' );";
}
}
if ($count > $this->limit)
$tableBody['Others'][0] = __('Others', 'wp-piwik');
foreach ($tableBody as $key => $row)
$tableBody[$key][2] = number_format($row[1]/$sum*100, 2).'%';
if (!empty($tableBody)) $this->pieChart($tableBody);
$this->table($tableHead, $tableBody, null, false, $js, $class);
}
}
}

View File

@ -1,38 +0,0 @@
<?php
namespace WP_Piwik\Widget;
class Search extends \WP_Piwik\Widget {
public $className = __CLASS__;
protected function configure($prefix = '', $params = array()) {
$timeSettings = $this->getTimeSettings();
$this->parameter = array(
'idSite' => self::$wpPiwik->getPiwikSiteId($this->blogId),
'period' => $timeSettings['period'],
'date' => $timeSettings['date']
);
$this->title = $prefix.__('Site Search', 'wp-piwik').' ('.__($timeSettings['description'],'wp-piwik').')';
$this->method = 'Actions.getSiteSearchKeywords';
}
public function show() {
$response = self::$wpPiwik->request($this->apiID[$this->method]);
if (!empty($response['result']) && $response['result'] ='error')
echo '<strong>'.__('Piwik error', 'wp-piwik').':</strong> '.htmlentities($response['message'], ENT_QUOTES, 'utf-8');
else {
$tableHead = array(__('Keyword', 'wp-piwik'), __('Requests', 'wp-piwik'), __('Bounced', 'wp-piwik'));
$tableBody = array();
$count = 0;
if (is_array($response))
foreach ($response as $row) {
$count++;
$tableBody[] = array(htmlentities($row['label']), $row['nb_visits'], $row['bounce_rate']);
if ($count == 10) break;
}
$this->table($tableHead, $tableBody, null);
}
}
}

View File

@ -1,31 +0,0 @@
<?php
namespace WP_Piwik\Widget;
class Seo extends \WP_Piwik\Widget {
public $className = __CLASS__;
protected function configure($prefix = '', $params = array()) {
$this->parameter = array(
'url' => get_bloginfo('url')
);
$this->title = $prefix.__('SEO', 'wp-piwik');
$this->method = 'SEO.getRank';
}
public function show() {
$response = self::$wpPiwik->request($this->apiID[$this->method]);
if (!empty($response['result']) && $response['result'] ='error')
echo '<strong>'.__('Piwik error', 'wp-piwik').':</strong> '.htmlentities($response['message'], ENT_QUOTES, 'utf-8');
else {
echo '<div class="table"><table class="widefat"><tbody>';
if (is_array($response))
foreach ($response as $val)
echo '<tr><td>'.(isset($val['logo_link']) && !empty($val['logo_link'])?'<a href="'.$val['logo_link'].'" title="'.$val['logo_tooltip'].'">'.$val['label'].'</a>':$val['label']).'</td><td>'.$val['rank'].'</td></tr>';
else echo '<tr><td>SEO module currently not available.</td></tr>';
echo '</tbody></table></div>';
}
}
}

View File

@ -1,73 +0,0 @@
<?php
namespace WP_Piwik\Widget;
class SystemDetails extends \WP_Piwik\Widget {
protected function configure($prefix = '', $params = array()) {
$timeSettings = $this->getTimeSettings();
$this->parameter = array(
'idSite' => self::$wpPiwik->getPiwikSiteId($this->blogId),
'period' => $timeSettings['period'],
'date' => $timeSettings['date']
);
$this->title = $prefix.__('Operation System Details', 'wp-piwik').' ('.__($timeSettings['description'],'wp-piwik').')';
$this->method = 'DevicesDetection.getOsVersions';
$this->context = 'normal';
wp_enqueue_script('wp-piwik', self::$wpPiwik->getPluginURL().'js/wp-piwik.js', array(), self::$wpPiwik->getPluginVersion(), true);
wp_enqueue_script('wp-piwik-jqplot',self::$wpPiwik->getPluginURL().'js/jqplot/wp-piwik.jqplot.js',array('jquery'));
wp_enqueue_style('wp-piwik', self::$wpPiwik->getPluginURL().'css/wp-piwik.css',array(),self::$wpPiwik->getPluginVersion());
add_action('admin_head-index.php', array($this, 'addHeaderLines'));
}
public function addHeaderLines() {
echo '<!--[if IE]><script language="javascript" type="text/javascript" src="'.self::$wpPiwik->getPluginURL().'js/jqplot/excanvas.min.js"></script><![endif]-->';
echo '<link rel="stylesheet" href="'.self::$wpPiwik->getPluginURL().'js/jqplot/jquery.jqplot.min.css" type="text/css"/>';
echo '<script type="text/javascript">var $j = jQuery.noConflict();</script>';
}
public function show() {
$response = self::$wpPiwik->request($this->apiID[$this->method]);
$tableBody = array();
if (!empty($response['result']) && $response['result'] ='error')
echo '<strong>'.__('Piwik error', 'wp-piwik').':</strong> '.htmlentities($response['message'], ENT_QUOTES, 'utf-8');
else {
$tableHead = array(__('Operation System', 'wp-piwik'), __('Unique', 'wp-piwik'), __('Percent', 'wp-piwik'));
if (isset($response[0]['nb_uniq_visitors'])) $unique = 'nb_uniq_visitors';
else $unique = 'sum_daily_nb_uniq_visitors';
$count = 0;
$sum = 0;
$js = array();
$class = array();
if (is_array($response))
foreach ($response as $row) {
$count++;
$sum += isset($row[$unique])?$row[$unique]:0;
if ($count < $this->limit)
$tableBody[$row['label']] = array($row['label'], $row[$unique], 0);
elseif (!isset($tableBody['Others'])) {
$tableBody['Others'] = array($row['label'], $row[$unique], 0);
$class['Others'] = 'wp-piwik-hideDetails';
$js['Others'] = '$j'."( '.wp-piwik-hideDetails' ).toggle( 'hidden' );";
$tableBody[$row['label']] = array($row['label'], $row[$unique], 0);
$class[$row['label']] = 'wp-piwik-hideDetails hidden';
$js[$row['label']] = '$j'."( '.wp-piwik-hideDetails' ).toggle( 'hidden' );";
} else {
$tableBody['Others'][1] += $row[$unique];
$tableBody[$row['label']] = array($row['label'], $row[$unique], 0);
$class[$row['label']] = 'wp-piwik-hideDetails hidden';
$js[$row['label']] = '$j'."( '.wp-piwik-hideDetails' ).toggle( 'hidden' );";
}
}
if ($count > $this->limit)
$tableBody['Others'][0] = __('Others', 'wp-piwik');
foreach ($tableBody as $key => $row)
$tableBody[$key][2] = number_format($row[1]/$sum*100, 2).'%';
if (!empty($tableBody)) $this->pieChart($tableBody);
$this->table($tableHead, $tableBody, null, false, $js, $class);
}
}
}

View File

@ -1,73 +0,0 @@
<?php
namespace WP_Piwik\Widget;
class Systems extends \WP_Piwik\Widget {
protected function configure($prefix = '', $params = array()) {
$timeSettings = $this->getTimeSettings();
$this->parameter = array(
'idSite' => self::$wpPiwik->getPiwikSiteId($this->blogId),
'period' => $timeSettings['period'],
'date' => $timeSettings['date']
);
$this->title = $prefix.__('Operation Systems', 'wp-piwik').' ('.__($timeSettings['description'],'wp-piwik').')';
$this->method = 'DevicesDetection.getOsFamilies';
$this->context = 'normal';
wp_enqueue_script('wp-piwik', self::$wpPiwik->getPluginURL().'js/wp-piwik.js', array(), self::$wpPiwik->getPluginVersion(), true);
wp_enqueue_script('wp-piwik-jqplot',self::$wpPiwik->getPluginURL().'js/jqplot/wp-piwik.jqplot.js',array('jquery'));
wp_enqueue_style('wp-piwik', self::$wpPiwik->getPluginURL().'css/wp-piwik.css',array(),self::$wpPiwik->getPluginVersion());
add_action('admin_head-index.php', array($this, 'addHeaderLines'));
}
public function addHeaderLines() {
echo '<!--[if IE]><script language="javascript" type="text/javascript" src="'.self::$wpPiwik->getPluginURL().'js/jqplot/excanvas.min.js"></script><![endif]-->';
echo '<link rel="stylesheet" href="'.self::$wpPiwik->getPluginURL().'js/jqplot/jquery.jqplot.min.css" type="text/css"/>';
echo '<script type="text/javascript">var $j = jQuery.noConflict();</script>';
}
public function show() {
$response = self::$wpPiwik->request($this->apiID[$this->method]);
$tableBody = array();
if (!empty($response['result']) && $response['result'] ='error')
echo '<strong>'.__('Piwik error', 'wp-piwik').':</strong> '.htmlentities($response['message'], ENT_QUOTES, 'utf-8');
else {
$tableHead = array(__('Operation System', 'wp-piwik'), __('Unique', 'wp-piwik'), __('Percent', 'wp-piwik'));
if (isset($response[0]['nb_uniq_visitors'])) $unique = 'nb_uniq_visitors';
else $unique = 'sum_daily_nb_uniq_visitors';
$count = 0;
$sum = 0;
$js = array();
$class = array();
if (is_array($response))
foreach ($response as $row) {
$count++;
$sum += isset($row[$unique])?$row[$unique]:0;
if ($count < $this->limit)
$tableBody[$row['label']] = array($row['label'], $row[$unique], 0);
elseif (!isset($tableBody['Others'])) {
$tableBody['Others'] = array($row['label'], $row[$unique], 0);
$class['Others'] = 'wp-piwik-hideDetails';
$js['Others'] = '$j'."( '.wp-piwik-hideDetails' ).toggle( 'hidden' );";
$tableBody[$row['label']] = array($row['label'], $row[$unique], 0);
$class[$row['label']] = 'wp-piwik-hideDetails hidden';
$js[$row['label']] = '$j'."( '.wp-piwik-hideDetails' ).toggle( 'hidden' );";
} else {
$tableBody['Others'][1] += $row[$unique];
$tableBody[$row['label']] = array($row['label'], $row[$unique], 0);
$class[$row['label']] = 'wp-piwik-hideDetails hidden';
$js[$row['label']] = '$j'."( '.wp-piwik-hideDetails' ).toggle( 'hidden' );";
}
}
if ($count > $this->limit)
$tableBody['Others'][0] = __('Others', 'wp-piwik');
foreach ($tableBody as $key => $row)
$tableBody[$key][2] = number_format($row[1]/$sum*100, 2).'%';
if (!empty($tableBody)) $this->pieChart($tableBody);
$this->table($tableHead, $tableBody, null, false, $js, $class);
}
}
}

View File

@ -1,80 +0,0 @@
<?php
namespace WP_Piwik\Widget;
use WP_Piwik\Widget;
class Types extends Widget {
public $className = __CLASS__;
protected function configure($prefix = '', $params = array()) {
$timeSettings = $this->getTimeSettings();
$this->parameter = array(
'idSite' => self::$wpPiwik->getPiwikSiteId($this->blogId),
'period' => $timeSettings['period'],
'date' => $timeSettings['date']
);
$this->title = $prefix.__('Types', 'wp-piwik').' ('.__($timeSettings['description'],'wp-piwik').')';
$this->method = 'DevicesDetection.getType';
$this->context = 'normal';
wp_enqueue_script('wp-piwik', self::$wpPiwik->getPluginURL().'js/wp-piwik.js', array(), self::$wpPiwik->getPluginVersion(), true);
wp_enqueue_script('wp-piwik-jqplot',self::$wpPiwik->getPluginURL().'js/jqplot/wp-piwik.jqplot.js',array('jquery'));
wp_enqueue_style('wp-piwik', self::$wpPiwik->getPluginURL().'css/wp-piwik.css',array(),self::$wpPiwik->getPluginVersion());
add_action('admin_head-index.php', array($this, 'addHeaderLines'));
}
public function addHeaderLines() {
echo '<!--[if IE]><script language="javascript" type="text/javascript" src="'.self::$wpPiwik->getPluginURL().'js/jqplot/excanvas.min.js"></script><![endif]-->';
echo '<link rel="stylesheet" href="'.self::$wpPiwik->getPluginURL().'js/jqplot/jquery.jqplot.min.css" type="text/css"/>';
echo '<script type="text/javascript">var $j = jQuery.noConflict();</script>';
}
public function show() {
$response = self::$wpPiwik->request($this->apiID[$this->method]);
$tableBody = array();
if (!empty($response['result']) && $response['result'] ='error')
echo '<strong>'.__('Piwik error', 'wp-piwik').':</strong> '.htmlentities($response['message'], ENT_QUOTES, 'utf-8');
else {
$tableHead = array(__('Type', 'wp-piwik'), __('Unique', 'wp-piwik'), __('Percent', 'wp-piwik'));
if (isset($response[0]['nb_uniq_visitors'])) $unique = 'nb_uniq_visitors';
else $unique = 'sum_daily_nb_uniq_visitors';
$count = 0;
$sum = 0;
$js = array();
$class = array();
if (is_array($response))
foreach ($response as $row) {
$count++;
$sum += isset($row[$unique])?$row[$unique]:0;
if ($count < $this->limit)
$tableBody[$row['label']] = array($row['label'], $row[$unique], 0);
elseif (!isset($tableBody['Others'])) {
$tableBody['Others'] = array($row['label'], $row[$unique], 0);
$class['Others'] = 'wp-piwik-hideDetails';
$js['Others'] = '$j'."( '.wp-piwik-hideDetails' ).toggle( 'hidden' );";
$tableBody[$row['label']] = array($row['label'], $row[$unique], 0);
$class[$row['label']] = 'wp-piwik-hideDetails hidden';
$js[$row['label']] = '$j'."( '.wp-piwik-hideDetails' ).toggle( 'hidden' );";
} else {
$tableBody['Others'][1] += $row[$unique];
$tableBody[$row['label']] = array($row['label'], $row[$unique], 0);
$class[$row['label']] = 'wp-piwik-hideDetails hidden';
$js[$row['label']] = '$j'."( '.wp-piwik-hideDetails' ).toggle( 'hidden' );";
}
}
if ($count > $this->limit)
$tableBody['Others'][0] = __('Others', 'wp-piwik');
elseif ($count == $this->limit) {
$class['Others'] = $js['Others'] = '';
}
foreach ($tableBody as $key => $row)
$tableBody[$key][2] = number_format($row[1]/$sum*100, 2).'%';
if (!empty($tableBody)) $this->pieChart($tableBody);
$this->table($tableHead, $tableBody, null, false, $js, $class);
}
}
}

View File

@ -1,68 +0,0 @@
<?php
namespace WP_Piwik\Widget;
class Visitors extends \WP_Piwik\Widget {
public $className = __CLASS__;
protected function configure($prefix = '', $params = array()) {
$timeSettings = $this->getTimeSettings();
$this->parameter = array(
'idSite' => self::$wpPiwik->getPiwikSiteId($this->blogId),
'period' => isset($params['period'])?$params['period']:$timeSettings['period'],
'date' => 'last'.($timeSettings['period']=='day'?'30':'12'),
'limit' => null
);
$this->title = $prefix.__('Visitors', 'wp-piwik').' ('.__($this->rangeName(),'wp-piwik').')';
$this->method = array('VisitsSummary.getVisits', 'VisitsSummary.getUniqueVisitors', 'VisitsSummary.getBounceCount', 'VisitsSummary.getActions');
$this->context = 'normal';
wp_enqueue_script('wp-piwik', self::$wpPiwik->getPluginURL().'js/wp-piwik.js', array(), self::$wpPiwik->getPluginVersion(), true);
wp_enqueue_script('wp-piwik-jqplot',self::$wpPiwik->getPluginURL().'js/jqplot/wp-piwik.jqplot.js',array('jquery'));
wp_enqueue_style('wp-piwik', self::$wpPiwik->getPluginURL().'css/wp-piwik.css',array(),self::$wpPiwik->getPluginVersion());
add_action('admin_head-index.php', array($this, 'addHeaderLines'));
}
public function show() {
$response = array();
$success = true;
foreach ($this->method as $method) {
$response[$method] = self::$wpPiwik->request($this->apiID[$method]);
if (!empty($response[$method]['result']) && $response[$method]['result'] ='error')
$success = false;
}
if (!$success)
echo '<strong>'.__('Piwik error', 'wp-piwik').':</strong> '.htmlentities($response[$method]['message'], ENT_QUOTES, 'utf-8');
else {
$data = array();
if (is_array($response) && is_array($response['VisitsSummary.getVisits']))
foreach ($response['VisitsSummary.getVisits'] as $key => $value) {
if ($this->parameter['period'] == 'week') {
preg_match("/[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])/", $key, $dateList);
$jsKey = $dateList[0];
$textKey = $this->dateFormat($jsKey, 'week');
} elseif ($this->parameter['period'] == 'month') {
$jsKey = $key.'-01';
$textKey = $key;
} else $jsKey = $textKey = $key;
$data[] = array(
$textKey,
$value,
$response['VisitsSummary.getUniqueVisitors'][$key]?$response['VisitsSummary.getUniqueVisitors'][$key]:'-',
$response['VisitsSummary.getBounceCount'][$key]?$response['VisitsSummary.getBounceCount'][$key]:'-',
$response['VisitsSummary.getActions'][$key]?$response['VisitsSummary.getActions'][$key]:'-'
);
$javaScript[] = 'javascript:wp_piwik_datelink(\''.urlencode('wp-piwik_stats').'\',\''.str_replace('-', '', $jsKey).'\',\''.(isset($_GET['wpmu_show_stats'])?(int) $_GET['wpmu_show_stats']:'').'\');';
}
$this->table(
array(__('Date', 'wp-piwik'), __('Visits', 'wp-piwik'), __('Unique', 'wp-piwik'), __('Bounced', 'wp-piwik'), __('Page Views', 'wp-piwik')),
array_reverse($data),
array(),
'clickable',
array_reverse(isset($javaScript)?$javaScript:[])
);
}
}
}

View File

@ -1,9 +0,0 @@
<?php
/******************************************************
* Configure WP-Piwik Logger
* 0: Logger disabled
* 1: Log to screen
* 2: Log to file (logs/YYYYMMDD_wp-piwik.log)
******************************************************/
define ( 'WP_PIWIK_ACTIVATE_LOGGER', 0 );

View File

@ -1,2 +0,0 @@
<?php
// Nothing to see...

View File

@ -1,3 +0,0 @@
.wp-piwik_dynbar canvas {
padding-top: 5px !important
}

View File

@ -1,57 +0,0 @@
.wp-piwik-hidden {
display: none;
}
table.wp-piwik-table th.right, td.right {
text-align: right;
}
table.wp-piwik-table tr:hover {
background-color: #ccc;
}
table.wp-piwik-table tbody.clickable {
cursor: pointer;
}
#wp-piwik_stats_vistors_graph {
overflow: hidden;
}
.wp-piwik_dynbar canvas {
padding-top: 5px !important
}
table.wp-piwik_menu-tab th {
vertical-align: top;
}
div.wp-piwik-debug {
padding:10px;
}
tr.wp-piwik-hideDetails {
cursor: pointer;
text-decoration: underline;
}
input.wp-piwik-wide {
width:100%;
}
div.wp-piwik-donate {
float:right;
width:220px;
background:#ffc;
padding:10px;
border:1px solid black;
margin: 10px 10px;
}
div.wp-piwik-donate div {
width:190px;
text-align:center;
border:solid black;
border-width:1px 0 0 0 ;
padding:5px
}

View File

@ -1,692 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>GNU General Public License - GNU Project - Free Software Foundation (FSF)</title>
</head><body>
<h3 style="text-align: center;">GNU GENERAL PUBLIC LICENSE</h3>
<p style="text-align: center;">Version 3, 29 June 2007</p>
<p>Copyright © 2007 Free Software Foundation, Inc. &lt;http://fsf.org/&gt;</p><p>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.</p>
<h3><a name="preamble"></a>Preamble</h3>
<p>The GNU General Public License is a free, copyleft license for
software and other kinds of works.</p>
<p>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.</p>
<p>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.</p>
<p>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.</p>
<p>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.</p>
<p>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.</p>
<p>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.</p>
<p>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.</p>
<p>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.</p>
<p>The precise terms and conditions for copying, distribution and
modification follow.</p>
<h3><a name="terms"></a>TERMS AND CONDITIONS</h3>
<h4><a name="section0"></a>0. Definitions.</h4>
<p>“This License” refers to version 3 of the GNU General Public License.</p>
<p>“Copyright” also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.</p>
<p>“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.</p>
<p>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.</p>
<p>A “covered work” means either the unmodified Program or a work based
on the Program.</p>
<p>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.</p>
<p>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.</p>
<p>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.</p>
<h4><a name="section1"></a>1. Source Code.</h4>
<p>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.</p>
<p>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.</p>
<p>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.</p>
<p>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.</p>
<p>The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.</p>
<p>The Corresponding Source for a work in source code form is that
same work.</p>
<h4><a name="section2"></a>2. Basic Permissions.</h4>
<p>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.</p>
<p>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.</p>
<p>Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.</p>
<h4><a name="section3"></a>3. Protecting Users' Legal Rights From Anti-Circumvention Law.</h4>
<p>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.</p>
<p>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.</p>
<h4><a name="section4"></a>4. Conveying Verbatim Copies.</h4>
<p>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.</p>
<p>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.</p>
<h4><a name="section5"></a>5. Conveying Modified Source Versions.</h4>
<p>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:</p>
<ul>
<li>a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.</li>
<li>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”.</li>
<li>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.</li>
<li>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.</li>
</ul>
<p>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.</p>
<h4><a name="section6"></a>6. Conveying Non-Source Forms.</h4>
<p>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:</p>
<ul>
<li>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.</li>
<li>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.</li>
<li>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.</li>
<li>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.</li>
<li>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.</li>
</ul>
<p>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.</p>
<p>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.</p>
<p>“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.</p>
<p>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).</p>
<p>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.</p>
<p>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.</p>
<h4><a name="section7"></a>7. Additional Terms.</h4>
<p>“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.</p>
<p>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.</p>
<p>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:</p>
<ul>
<li>a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or</li>
<li>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</li>
<li>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</li>
<li>d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or</li>
<li>e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or</li>
<li>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.</li>
</ul>
<p>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.</p>
<p>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.</p>
<p>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.</p>
<h4><a name="section8"></a>8. Termination.</h4>
<p>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).</p>
<p>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.</p>
<p>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.</p>
<p>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.</p>
<h4><a name="section9"></a>9. Acceptance Not Required for Having Copies.</h4>
<p>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.</p>
<h4><a name="section10"></a>10. Automatic Licensing of Downstream Recipients.</h4>
<p>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.</p>
<p>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.</p>
<p>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.</p>
<h4><a name="section11"></a>11. Patents.</h4>
<p>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”.</p>
<p>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.</p>
<p>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.</p>
<p>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.</p>
<p>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.</p>
<p>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.</p>
<p>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.</p>
<p>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.</p>
<h4><a name="section12"></a>12. No Surrender of Others' Freedom.</h4>
<p>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.</p>
<h4><a name="section13"></a>13. Use with the GNU Affero General Public License.</h4>
<p>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.</p>
<h4><a name="section14"></a>14. Revised Versions of this License.</h4>
<p>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.</p>
<p>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.</p>
<p>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.</p>
<p>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.</p>
<h4><a name="section15"></a>15. Disclaimer of Warranty.</h4>
<p>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.</p>
<h4><a name="section16"></a>16. Limitation of Liability.</h4>
<p>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.</p>
<h4><a name="section17"></a>17. Interpretation of Sections 15 and 16.</h4>
<p>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.</p>
<p>END OF TERMS AND CONDITIONS</p>
<h3><a name="howto"></a>How to Apply These Terms to Your New Programs</h3>
<p>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.</p>
<p>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.</p>
<pre> &lt;one line to give the program's name and a brief idea of what it does.&gt;
Copyright (C) &lt;year&gt; &lt;name of author&gt;
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 &lt;http://www.gnu.org/licenses/&gt;.
</pre>
<p>Also add information on how to contact you by electronic and paper mail.</p>
<p>If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:</p>
<pre> &lt;program&gt; Copyright (C) &lt;year&gt; &lt;name of author&gt;
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.
</pre>
<p>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”.</p>
<p>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
&lt;http://www.gnu.org/licenses/&gt;.</p>
<p>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
&lt;http://www.gnu.org/philosophy/why-not-lgpl.html&gt;.</p>
</body></html>

View File

@ -1,2 +0,0 @@
<?php
// Nothing to see...

View File

@ -1,2 +0,0 @@
<?php
// Nothing to see...

View File

@ -1 +0,0 @@
This package contains just parts needed by WP-Piwik. To get the full package of jqPlot, visit http://www.jqplot.com/

View File

@ -1,21 +0,0 @@
Title: MIT License
Copyright (c) 2009-2013 Chris Leonello
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.

View File

@ -1,77 +0,0 @@
Title: jqPlot Readme
Pure JavaScript plotting plugin for jQuery.
To learn how to use jqPlot, start with the Basic Usage Instructions below. Then read the
usage.txt and jqPlotOptions.txt files included with the distribution.
The jqPlot home page is at <http://www.jqplot.com/>.
Downloads can be found at <http://bitbucket.org/cleonello/jqplot/downloads/>.
The mailing list is at <http://groups.google.com/group/jqplot-users>.
Examples and unit tests are at <http://www.jqplot.com/tests/>.
Documentation is at <http://www.jqplot.com/docs/>.
The project page and source code are at <http://www.bitbucket.org/cleonello/jqplot/>.
Bugs, issues, feature requests: <http://www.bitbucket.org/cleonello/jqplot/issues/>.
Basic Usage Instructions:
jqPlot requires jQuery (1.4+ required for certain features). jQuery 1.9.1 is included in
the distribution. To use jqPlot include jQuery, the jqPlot jQuery plugin, the jqPlot css file and
optionally the excanvas script to support IE version prior to IE 9 in your web page:
> <!--[if lt IE 9]><script language="javascript" type="text/javascript" src="excanvas.js"></script><![endif]-->
> <script language="javascript" type="text/javascript" src="jquery-1.4.4.min.js"></script>
> <script language="javascript" type="text/javascript" src="jquery.jqplot.min.js"></script>
> <link rel="stylesheet" type="text/css" href="jquery.jqplot.css" />
For usage instructions, see <jqPlot Usage> in usage.txt. For available options, see
<jqPlot Options> in jqPlotOptions.txt.
Building from source:
If you've cloned the repository, you can build a distribution from source.
You need to have ant <http://ant.apache.org> installed. You can simply
type "ant" from the jqplot directory to build the default "all" target.
There are 6 pertinent targets: clean, dist, min, docs, compress and all. Use:
> ant -p
to get a description of the various build targets.
Legal Notices:
Copyright (c) 2009-2013 Chris Leonello
jqPlot is currently available for use in all personal or commercial projects
under both the MIT and GPL version 2.0 licenses. This means that you can
choose the license that best suits your project and use it accordingly.
Although not required, the author would appreciate an email letting him
know of any substantial use of jqPlot. You can reach the author at:
chris at jqplot or see http://www.jqplot.com/info.php .
If you are feeling kind and generous, consider supporting the project by
making a donation at: http://www.jqplot.com/donate.php .
jqPlot includes date instance methods and printf/sprintf functions by other authors:
Date instance methods:
author Ken Snyder (ken d snyder at gmail dot com)
date 2008-09-10
version 2.0.2 (http://kendsnyder.com/sandbox/date/)
license Creative Commons Attribution License 3.0 (http://creativecommons.org/licenses/by/3.0/)
JavaScript printf/sprintf functions.
version 2007.04.27
author Ash Searle
http://hexmen.com/blog/2007/03/printf-sprintf/
http://hexmen.com/js/sprintf.js
The author (Ash Searle) has placed this code in the public domain:
"This code is unrestricted: you are free to use it however you like."

View File

@ -1,458 +0,0 @@
Title: Change Log
1.0.8:
* Issue #375: sortMergedLabels does not sort string labels
* Issue #279: Groups > 3 Causes Alignment Issues
* Issue #439: IE can't display a customized legend in Quirks mode
* Issue #482: "Undefined" error message when plotting a chart with no data
* Issue #116: Don't mix spaces and tabs for indentation
* Issue #564: Metergauge renderer not resizable when replotting
* Issue #409: MeterGaugeRenderer replot/redraw offsets center
* Issue #523: Adding rectangles to Canvas Overlay plugin
* Issue #756: jqplot.min files contain non-UTF-8 characters
* Issue #223: fillToZero does not color negative values when crossover point is 0
* Pull Request #23: Adding rectangles to Canvas Overlay plugin
* Pull Request #28: Cross-over points of 0 will actually change colors
* Pull Request #35: Don't highlight hidden bars or show tooltips for them
* Pull Request #41: Add dutch(nl) and svenska(sv) translations for dates
* Add tooltip support for Pie Charts
* Update to latest YUI compressor
1.0.7:
* Issue #726: Bug in sprintf %p, sometimes it outputs exponential form rather than decimal
* Issue #717: Plot's preDrawHooks not called
* Issue #707: Browser hangs with LogAxisRenderer when value is 0
* Issue #695: Horizontal Bar Chart Negative Series Colors Not Working
* Issue #670: Examples IE7, IE8 and IE9 multipleBarColors.html failure and fix
* Issue #636: X Axis Date Renderer Single Day Not plotting
* Issue #607: Integration issue
* Issue #571: Decimal numbers not properly formatted
* Issue #552: jqPlot crashes when interval too small
* Issue #536: DateAxisRenderer invalid scaling
* Issue #534: "decimalMark" in the "jqplot.sprintf.js"
* Issue #529: Scientific notation on label values ending in 0
* Issue #521: invalid JS in meterGaugeRenderer.js
* Issue #516: Including BezierCurveRenderer plugin and initializing jqplot with no options give error
* Issue #500: DateAxisRenderer has timezone related issues
* Issue #452: Including ALL jqPlot plugins causes an Error
* Issue #494: No point when use LogAxisRenderer and a point has a zero value
* Issue #430: getIsoWeek: invalid method call
* Issue #280: jqplot Options
* Issue #179: Spelling/grammar
* Pull Request #18: Implement getTop in CanvasAxisTickRenderer
* Pull Request #21: Performance issue when drawing pointlabels with zeros/null values
* Pull Request #24: Added suggested fix in comment #8 for issue #536
* Pull Request #29: Removed unbalanced addition of UTC offset
* Pull Request #33: Documentation fixes (issue #179, other changes)
* Pull Request #34: Start of updating jqPlotOptions.txt
* Pull Request #37: Example and suggested fix for issues #552 and issue #536
* Pull Request #39: Fixed trailing comma which caused issues with IE7
1.0.6:
* Add left sidebar navigation to examples
* Update examples for jquery 1.9.1 and jquery ui 1.10.0
* Add colorpicker.js to distribution
* Fix some problems with examples when viewing with local file system
* Add "minified" copyright notice for minified files, similar to jquery's notice.
* Pull Request #25: jqplot.sprintf.js is no longer the last file in the concatenated jquery.jqplot.js
* Pull Request #17: Fixed bug causing custom pointLabels passed with plot data to be ignored for horizontal bar graphs.
* Pull Request #10: Build error by invalid encoding.
* Issue #714: handle tickColor in meterGaugeRenderer
* Issue #519: jsDate Polish Localization
1.0.5:
* Updated to jQuery 1.9
1.0.0b2:
* Major improvements in memory usage:
** Merged in changes from Timo Besenruether to reuse canvas elements and improve
memory performance.
** Fixed all identifiable DOM leaks.
** Mergged in changes from cguillot for memory improvements in IE < 9.
* Added vertical and dashed vertical line support for canvas overlay.
* Fixed bug where initially hidden plots would not display.
* Fixed bug with point labels and null data points.
* Updated to jQuery 1.6.1.
* Improved pie slice margin calculation and fixed slice margin and pie positioning
with small slices.
* Improved bar renderer so bars always start at 0 if:
** The axis is a linear axis (not log/date).
** There are no other line types besides bars attached to the axis.
** The data on the axis is all >= 0.
** The user has not specified a pad, padMin or forceTickAt0 = true option.
* Modified tick prefix behavious so prefix no added to all ticks, even if format
string is specified.
* Fix to ensure original tick formats are applied when zooming and resetting
zoom.
* Updated auto tick format string so format adjusted when zooming.
* Modified auto tick computation to put less ticks on small plots and more
ticks on large plots.
* Update bubble render to support gradients in IE 9.
1.0.0b1:
* Much improved tick generation algorithm to get precise rounded
tick values (Thanks Scott Prahl!).
* Auto compute tick format string if none is provided.
* Much better "slicing" of pie charts when using "sliceMargin" option to set
a gap between the slices.
* Expanded canvasOverlay plugin to create arbitrary dashed and solid
horizontal and vertical lines on top of plot.
* Added defaultColors and defaultNegativeColors options to $.jqplot.config.
* Fixed issue #318, highlighter & bar renderer incompatability.
* Improve highlighter tooltip positioning with negative bars.
* Fixed #305, mispelling of jqlotDragStart and jqlotDragStop. MUST NOW BIND
TO jqplotDragStart and jqplotDragStop.
* Fixed #290, some variables left in global scope.
* Fixed #289, OHLC line widths hard coded at 1.5. Now set by lineWidth option.
* Fixed #296 for determining databounds on log axes.
* Updated to jQuery 1.5.1
* Fixed waterfall plot to ensure first and last bars always fill to zero.
* Added lineJoin and lineCap option to series lines.
* Bar widths now based on width of grid, not plot target for better scaling.
* Added looseZoom option to cursor so zooming can produce well rounded ticks.
* Added forceTickAt0 and forceTickAt100 options to ensure there will always
be a tick at 0 or 100 in the plot.
* Fixed bug where cursor legend didn't honor series showLabel option.
1.0.0a:
* Series can now be moved forward or backward in stack to e.g. bring a line
forward when mousing over a point.
* Can now move outside of grid area while zooming. Can have zoom
constrained to grid area or allow zooming outside.
* Fixed issue #142 with tooltip drawn on top of event canvas, hiding
mouse events.
* Fixed #147 where pie slices with 0 value not rendering properly in IE.
* Fixed #130 where stack data not sorted properly.
* Fixed bug with null values not handled properly in category axes.
* Fixed #156 where pie charts not rendering on QTWebKit.
* Now using feature detection for canvas and canvas text capability
rather than browser version.
* Added enahncedLegendRenderer plugin to allow multi row/column legends
and clickable labels to show/hide series.
* Added fillToValue option to allow filled line plot to fill to an
arbitrary value.
* Added block plot plugin.
* Added funnel type charts.
* Added meter gauge type charts.
* Added plot theming support.
* $.jqplot.config.enablePlugins now false by default.
* Implemented highlighting on bar, pie, donut, funnel, etc. charts.
* Fix to pointlabels plugin to align labels properly on multi series plots.
* Added custom error handling to display error message in plot area.
* Fixed issue where would call to draw grid border of 0 width would
result in a default border being drawn.
* Added options to place legend outside of grid and shrink grid so everything
stays within plot div.
* Fixed bug in color generator so now calls to get() continually cycle
through colors just like next().
* Added defaultAxisStart option.
* Added gradient fills to bubbles.
* Added bubble charts.
* Added showLabels option to bubble charts.
* Pass bubble radius to event callback in bubble charts.
* Fixed #207, typo in docs.
* Fixed #206 where "value" pie slice data labels were displaying wrong
value.
* Fixed #147 with 0 value slices in IE6.
* Fixed issue #241, disabled varyBarColor option in stacked charts.
* Added dataRenderer option to allow custom processors for JSON, AJAX
and anywhere else you might want to get data.
* Fixed null value handling so plot now properly skip or join over nulls.
* Fixed showTicks and showTickMarks option conflicts.
* Fixed issue #185 where pointLabels plugin incompatibility could crash
pie, donut and other plots.
* Fixed #23 and #143 to obey gridPadding option.
* Fixed #233 with highlighter tooltip separator.
* Fixed #224 where type checking failing on GWT.
* Fixed #272 with pie highlighting not working on replot.
* Memory performance improvements.
* Changes to build script so everything should build when pulled from repo.
* Fixed issue #275, IE 6/7 don't support array indexing of strings.
* Added event listener hooks for mouseUp, mouseDown, etc. to all line plots.
* Fixed bug with highlighter not working when null in data.
* Updated to jQuery 1.4.4
* Fixed bug where donut plots showed value of radians of slice instead
of actual data.
* Reverted to excanvas r3 so IE8 no longer has to emulate IE7.
* Added tooltipContentEditor option to highlighter, allowing callback
to manipulate tooltip content at run time (thanks Tim Bunce!).
* Fixed bug where axes scale not resetting.
* Fixed bug with date axes where data bounds not properly set.
* Fixed issue where tick marks disappear if grid lines turned off.
* Updated replot method to allow passing in axes options for more control.
* Added experimental support for "broken" axes.
* Fixed bug with pies where pies with 0 valued slices did not draw correctly.
* Added canvasOverlay plugin to allow drawing of arbitrary shapes on a canvas
over the plot.
* Added option to display arbitrary text/html (message, animated gif, etc.) if
plot is constructed without data. Allow a "data loading" indicator to be shown.
* Added resetAxisValues method to manually update axis ticks without
redrawing the plot.
* Fix to labels on negative bars so label postiion of 'n' will be below a negative bar,
just as it is above a positive bar (thanks guigod!).
* Added thousands separator character (') to sprintf formatting (thanks yuichi1004!).
* Re-factored date parsing/formatting to use new jsDate module which does not
extend the Date prototype.
0.9.7:
* Added Mekko chart plot type with enhanced legend and axes support.
* Implemented vertical waterfall charts. Can create waterfall plot as
option to bar chart. See examples folder of distribution.
* Enhanced plot labels for waterfall style.
* Enhanced bar plots so you can now color each bar of a series
independently with the "varyBarColor" option.
* Re-factored series drawing so that each series and series shadow drawn
on its own canvas. Allows series to be redrawn independently of each other.
* Added additional default series colors.
* Added useNegativeColors option to turn off negative color array and use
only seriesColors array to define all bar/filled line colors.
* Fix css for cursor legend.
* Modified shape renderer so rectangles can be stroked and filled.
* Re-factored date methods out of dateAxisRenderer so that date formatter
and methods can be accesses outside of dateAxisRenderer plugin.
* Fixed #132, now trigger series change event on plot target instead of drag canvas.
* Fixes issue #116 where some source files had mix of tabs and spaces
for indentation. Should have been all spaces.
* Fixed issue #126, some links broken in docs section of web site.
* Fixed issue #90, trendline plugin incompatibility with pie renderer.
* Updated samples in examples folder of distribution to include navigation
links if web server is set up to process .html files with php.
0.9.6:
* New, easier to use, replot() method for placing plots in tabs, accordions,
resizable containers or for changing plot parameters programmatically.
* Updated legend renderer for pie charts to draw swatches which will
print correctly.
* Fixed issue #118 with patch from taum so autoscale option will
honor tickInterval and numberTicks options
* Fix to plot diameter calculation for initially hidden plots.
* Added examples for making plots in jQuery UI tabs and accordions.
* Fixed issue #120 where pie chart with single slice not displaying
correctly in IE and Chrome
0.9.5.2:
* Fixed #102 where double clicking on plot that has zoom enabled, but
has not been zoomed resulted in error.
* Fixed bug where candlestick coloring options not working.
* Added option to turn individual series labels off in the legend.
0.9.5.1:
* Fixed bug where tooltip not working with OHLC and candlestick charts.
* Added additional marker styles: plus, X and dash.
0.9.5:
* Implemented "zoomProxy". zoomProxy allows zooming one plot from another
such as an overview plot.
* Zooming can now be constrained to just x or y axis.
* Enhanced cursor plugin with vertical "dataTracking" line. This is a line
at the cursor location with a readout of data points at the line location
which are displayed in the chart legend.
* Changed cursor tooltip format string. Now one format string is used for
entire tooltip.
* Added mechanisms to specify plot size when plot target is hidden or plot
height/width otherwise cannot be determined from markup.
* Added $.jqplot.config object to specify jqplot wide configuration options.
These include enablePlugins to globally set the default plugin state on/off
and defaultHeight/defaultWidth to specify default plot height/width.
* Added fillToZero option which forces filled charts to fill to zero as opposed
to axis minimum. Thus negative filled bar/line values will fill upwards to
zero axis value.
* Added option to disable stacking on individual lines.
* Changed targetId property of the plot object so it now includes a "#" before
the id string.
* Improved tick and body sizing of Open Hi Low Close and candlestick charts.
* Removed lots of web site related files from the repository. This means that,
if working from the sources, user's won't be able to build the jqplot web
site and the docs/tests that are hosted on that site. The minified and
compressed distribution packages will build fine.
* Lots of examples were added to a separate examples directory to better show
functionality of jqPlot for local testing with the distribution.
* Many various bug fixes and other minor enhancements.
0.9.4:
* Implemented axis labels. Labels can be rendered in div tags or as canvas
elements supporting rotated text.
* Improved rotated axis label positioning so labels will start or end at a
tick position.
* Fixed bug where an empty data series would hang plot rendering.
* completed issue #66 for misc. improvements to documentation.
* Fixed issue #64 where the same ID's were assigned to cursor and highlighter
elements.
* Added option to legend to encode special HTML characters.
* Fixed undesirable behavior where point labels for points off the plot
were being rendered.
* Added edgeTolerance option to point label renderer to control rendering of
labels near plot edges.
0.9.3:
* Preliminary support for axis labels. Currently rendered into DIV tags,
so no rotated label support. This feature is currently experimental.
* Fixed bug #52, needed space in tick div tag between style and class declarations
or plot failed in certain application doctypes.
* Fixed issue #54, miter style line join for chart lines causing spikes at steep
changes in slope. Changed miter style to round.
* Added examples for new autoscaling algorithm.
* Fixed bug #57, category axis labels disappear on redraw()
* Improved algorithm which controlled maximum number of labels that would display
on a category axis.
* Fixed bug #45 where null values causing errors in plotData and gridData.
* Fixed issue #60 where seriesColors option was not working.
0.9.2:
* Fixed bug #45 where a plot could crash if series had different numbers of points.
* Fixed issue #50, added option to turn off sorting of series data.
* Fixed issue #31, implemented a better axis autoscaling algorithm and added an autoscale option.
0.9.1:
* Fixed bug #40, when axis pad, padMax, padMin set to 0, graph would fail to render.
* Fixed bug #41 where pie and bar charts not rendered correctly on redraw().
* Fixed bug #11, filled stacked line plots not rendering correctly in IE.
* Fixed bug #42 where stacked charts not rendering with string date axis ticks.
* Fixed bug in redraw() method where axes ticks were not reset.
* Fixed "jqplotPreRedrawEvent" that should have been named "jqplotPostRedraw" event.
0.9.0:
* Added Open Hi Low Close charts, Candlestick charts and Hi Low Close charts.
* Added support for arbitrary labels on the data points.
* Enhanced highlighter plugin to allow custom formatting control of entire tooltip.
* Enhanced highlighter to support multiple y values in a data point.
* Fixed bug #38 where series with a single point with a negative value would fail.
* Improvements to examples to show what plugins to include.
* Expanded documentation for some of the plugins.
0.8.5:
* Added zooming ability with double click or single click options to reset zoom.
* Modified default tick spacing algorithm for date axes to give more space to ticks.
* Fixed bug #2 where tickInterval wasn't working properly.
* Added neighborThreshold option to control how close mouse must be to
point to trigger neighbor detection.
* Added double click event handler on plot.
0.8.0:
* Support for up to 9 y axes.
* Added option to control padding at max/min bounds of axes separately.
* Closed issue #21, added options to control grid line color and width.
* Closed issue #20, added options to filled line charts to stoke above
fill and customize fill color and transparency.
* Improved structure of on line documentation to make usage and options
docs default.
* Added much documentation on options and css styling.
0.7.1:
* Bug fix release
* Fixed bug #6, missing semi-colons messing up some javascript compressors.
* Fixed bug #13 where 2D ticks array of [values, labels] would fail to
renderer with DateAxisRenderer.
* Fixes bug #16 where pie renderer overwriting options for all plot types
and crashing non pie plots.
* Fixes bug #17 constrainTo dragable option mispelled as "contstrainTo".
Fixed dragable color issue when used with trend lines.
0.7.0:
* Pie chart support
* Enabled tooltipLocation option in highlighter.
* Highlighter Tooltip will account for mark size and highlight size when
positioning itself.
* Added ability to show just x, y or both axes in highlighter tooltip.
* Added customization of separator between axes values in highlighter tooltip.
* Modified how shadows are drawn for lines, bars and markers. Now drawn first,
so they are always behind the object.
* Adjustments to shadow parameters on lines to account for new shadow positioning.
* Added a ColorGenerator class to robustly return next available color
for a plot with wrap around to first color at end.
* Udates to docs about css file.
* Fixed bug with String x values in series and IE error on sorting (Category Axis).
* Added cursor changes in dragable plugin when cursor near dragable point.
0.6.6b:
* Added excanvas.js and excanvas.min.js to compressed distributions.
* Added example/test html pages I had locally into repository and to
compressed distributions.
0.6.6a:
* Removed absolute positioning from dom element and put back into css file.
* Duplicate of 0.6.6 with a suffix to unambiguously differentiate between
previously posted 0.6.6 release.
0.6.6:
* Fixed bug #5, trend line plugin failing when no trend line options specified.
* Added absolute position css spec to axis tick dom element.
* Enhancement to category axes, more intuitive handling of series with
missing data values.
0.6.5:
* Fixed bug #4, series of unequal data length not rendering correctly.
This is a bugfix release only.
0.6.4:
* Fixed bug (issue #1 in tracker) where flat line data series (all x and/or y
values are euqal) or single value data series would crash.
0.6.3:
* Support for stacked line (a.k.a. area) and stacked bar (horizontal and
vertical) charts.
* Refactored barRenderer to use default shape and shadow renderers.
* Added info (contacts & support information) page to web site.
0.6.2:
* This is a minor upgrade to docs and build only. No functionality has changed.
* Ant build script generates entire site, examples, tests and distribution.
* Improvements to documentation.
0.6.1:
* New sprintf implementation from Ash Searle that implements %g.
* Fix to sprintf e/f formats.
* Created new format specifier, %p and %P to preserve significance.
* Modified p/P format to better display larger numbers.
* Fixed and simplified significant digits calculation for sprintf.
* Added option to have cursor tooltip follow the mouse or not.
* Added options to change size of highlight.
* Updates to handle dates like '6-May-09'.
* Mods to improve look of web site.
* Updates to documentation.
* Added license and copyright statement to source files.
0.6.0:
* Added rotated text support. Uses native canvas text functionality in
browsers that support it or draws text on canvas with Hershey font
* metrics for non-supporting browsers.
* Removed lots of lint in js code.
* Moved tick css from js code into css file.
* Fix to tick positioning css. y axis ticks were positioned to wrong side of axis div.
* Re-factored axis tick renderer instantiation into the axes renderers themselves.
For changes prior to 0.6.0 release, please see change log at http://bitbucket.org/cleonello/jqplot/changesets/

View File

@ -1,56 +0,0 @@
/**
* jqPlot
* Pure JavaScript plotting plugin using jQuery
*
* Version: @VERSION
*
* Copyright (c) 2009-2013 Chris Leonello
* jqPlot is currently available for use in all personal or commercial projects
* under both the MIT (http://www.opensource.org/licenses/mit-license.php) and GPL
* version 2.0 (http://www.gnu.org/licenses/gpl-2.0.html) licenses. This means that you can
* choose the license that best suits your project and use it accordingly.
*
* Although not required, the author would appreciate an email letting him
* know of any substantial use of jqPlot. You can reach the author at:
* chris at jqplot dot com or see http://www.jqplot.com/info.php .
*
* If you are feeling kind and generous, consider supporting the project by
* making a donation at: http://www.jqplot.com/donate.php .
*
* sprintf functions contained in jqplot.sprintf.js by Ash Searle:
*
* version 2007.04.27
* author Ash Searle
* http://hexmen.com/blog/2007/03/printf-sprintf/
* http://hexmen.com/js/sprintf.js
* The author (Ash Searle) has placed this code in the public domain:
* "This code is unrestricted: you are free to use it however you like."
*
* included jsDate library by Chris Leonello:
*
* Copyright (c) 2010-2013 Chris Leonello
*
* jsDate is currently available for use in all personal or commercial projects
* under both the MIT and GPL version 2.0 licenses. This means that you can
* choose the license that best suits your project and use it accordingly.
*
* jsDate borrows many concepts and ideas from the Date Instance
* Methods by Ken Snyder along with some parts of Ken's actual code.
*
* Ken's origianl Date Instance Methods and copyright notice:
*
* Ken Snyder (ken d snyder at gmail dot com)
* 2008-09-10
* version 2.0.2 (http://kendsnyder.com/sandbox/date/)
* Creative Commons Attribution License 3.0 (http://creativecommons.org/licenses/by/3.0/)
*
* jqplotToImage function based on Larry Siden's export-jqplot-to-png.js.
* Larry has generously given permission to adapt his code for inclusion
* into jqPlot.
*
* Larry's original code can be found here:
*
* https://github.com/lsiden/export-jqplot-to-png
*
*
*/

File diff suppressed because one or more lines are too long

View File

@ -1,280 +0,0 @@
Title: GPL Version 2
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Lesser General Public License instead.) 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
this service 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 make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. 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.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute 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 and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
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
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the 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 a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, 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.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE 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.

View File

@ -1,2 +0,0 @@
<?php
// Nothing to see...

View File

@ -1 +0,0 @@
.jqplot-target{position:relative;color:#666;font-family:"Trebuchet MS",Arial,Helvetica,sans-serif;font-size:1em}.jqplot-axis{font-size:.75em}.jqplot-xaxis{margin-top:10px}.jqplot-x2axis{margin-bottom:10px}.jqplot-yaxis{margin-right:10px}.jqplot-y2axis,.jqplot-y3axis,.jqplot-y4axis,.jqplot-y5axis,.jqplot-y6axis,.jqplot-y7axis,.jqplot-y8axis,.jqplot-y9axis,.jqplot-yMidAxis{margin-left:10px;margin-right:10px}.jqplot-axis-tick,.jqplot-xaxis-tick,.jqplot-yaxis-tick,.jqplot-x2axis-tick,.jqplot-y2axis-tick,.jqplot-y3axis-tick,.jqplot-y4axis-tick,.jqplot-y5axis-tick,.jqplot-y6axis-tick,.jqplot-y7axis-tick,.jqplot-y8axis-tick,.jqplot-y9axis-tick,.jqplot-yMidAxis-tick{position:absolute;white-space:pre}.jqplot-xaxis-tick{top:0;left:15px;vertical-align:top}.jqplot-x2axis-tick{bottom:0;left:15px;vertical-align:bottom}.jqplot-yaxis-tick{right:0;top:15px;text-align:right}.jqplot-yaxis-tick.jqplot-breakTick{right:-20px;margin-right:0;padding:1px 5px 1px 5px;z-index:2;font-size:1.5em}.jqplot-y2axis-tick,.jqplot-y3axis-tick,.jqplot-y4axis-tick,.jqplot-y5axis-tick,.jqplot-y6axis-tick,.jqplot-y7axis-tick,.jqplot-y8axis-tick,.jqplot-y9axis-tick{left:0;top:15px;text-align:left}.jqplot-yMidAxis-tick{text-align:center;white-space:nowrap}.jqplot-xaxis-label{margin-top:10px;font-size:11pt;position:absolute}.jqplot-x2axis-label{margin-bottom:10px;font-size:11pt;position:absolute}.jqplot-yaxis-label{margin-right:10px;font-size:11pt;position:absolute}.jqplot-yMidAxis-label{font-size:11pt;position:absolute}.jqplot-y2axis-label,.jqplot-y3axis-label,.jqplot-y4axis-label,.jqplot-y5axis-label,.jqplot-y6axis-label,.jqplot-y7axis-label,.jqplot-y8axis-label,.jqplot-y9axis-label{font-size:11pt;margin-left:10px;position:absolute}.jqplot-meterGauge-tick{font-size:.75em;color:#999}.jqplot-meterGauge-label{font-size:1em;color:#999}table.jqplot-table-legend{margin-top:12px;margin-bottom:12px;margin-left:12px;margin-right:12px}table.jqplot-table-legend,table.jqplot-cursor-legend{background-color:rgba(255,255,255,0.6);border:1px solid #ccc;position:absolute;font-size:.75em}td.jqplot-table-legend{vertical-align:middle}td.jqplot-seriesToggle:hover,td.jqplot-seriesToggle:active{cursor:pointer}.jqplot-table-legend .jqplot-series-hidden{text-decoration:line-through}div.jqplot-table-legend-swatch-outline{border:1px solid #ccc;padding:1px}div.jqplot-table-legend-swatch{width:0;height:0;border-top-width:5px;border-bottom-width:5px;border-left-width:6px;border-right-width:6px;border-top-style:solid;border-bottom-style:solid;border-left-style:solid;border-right-style:solid}.jqplot-title{top:0;left:0;padding-bottom:.5em;font-size:1.2em}table.jqplot-cursor-tooltip{border:1px solid #ccc;font-size:.75em}.jqplot-cursor-tooltip{border:1px solid #ccc;font-size:.75em;white-space:nowrap;background:rgba(208,208,208,0.5);padding:1px}.jqplot-highlighter-tooltip,.jqplot-canvasOverlay-tooltip{border:1px solid #ccc;font-size:.75em;white-space:nowrap;background:rgba(208,208,208,0.5);padding:1px}.jqplot-point-label{font-size:.75em;z-index:2}td.jqplot-cursor-legend-swatch{vertical-align:middle;text-align:center}div.jqplot-cursor-legend-swatch{width:1.2em;height:.7em}.jqplot-error{text-align:center}.jqplot-error-message{position:relative;top:46%;display:inline-block}div.jqplot-bubble-label{font-size:.8em;padding-left:2px;padding-right:2px;color:rgb(20%,20%,20%)}div.jqplot-bubble-label.jqplot-bubble-label-highlight{background:rgba(90%,90%,90%,0.7)}div.jqplot-noData-container{text-align:center;background-color:rgba(96%,96%,96%,0.3)}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,3 +0,0 @@
/* jqPlot 1.0.8r1250 | (c) 2009-2013 Chris Leonello | jplot.com
jsDate | (c) 2010-2013 Chris Leonello
*/(function(f){f.jqplot.Trendline=function(){this.show=f.jqplot.config.enablePlugins;this.color="#666666";this.renderer=new f.jqplot.LineRenderer();this.rendererOptions={marker:{show:false}};this.label="";this.type="linear";this.shadow=true;this.markerRenderer={show:false};this.lineWidth=1.5;this.shadowAngle=45;this.shadowOffset=1;this.shadowAlpha=0.07;this.shadowDepth=3;this.isTrendline=true};f.jqplot.postSeriesInitHooks.push(e);f.jqplot.postDrawSeriesHooks.push(g);f.jqplot.addLegendRowHooks.push(a);function a(k){var j=null;if(k.trendline&&k.trendline.show){var i=k.trendline.label.toString();if(i){j={label:i,color:k.trendline.color}}}return j}function e(m,k,j,i,l){if(this._type&&(this._type==="line"||this._type=="bar")){this.trendline=new f.jqplot.Trendline();i=i||{};f.extend(true,this.trendline,{color:this.color},j.trendline,i.trendline);this.trendline.renderer.init.call(this.trendline,null)}}function g(m,i){i=f.extend(true,{},this.trendline,i);if(this.trendline&&i.show){var k;var l=i.data||this.data;k=c(l,this.trendline.type);var j=i.gridData||this.renderer.makeGridData.call(this,k.data);this.trendline.renderer.draw.call(this.trendline,m,j,{showLine:true,shadow:this.trendline.shadow})}}function b(w,v,n){var u=(n==null)?"linear":n;var s=w.length;var t;var z;var o=0;var m=0;var r=0;var q=0;var l=0;var j=[];var k=[];if(u=="linear"){k=w;j=v}else{if(u=="exp"||u=="exponential"){for(var p=0;p<v.length;p++){if(v[p]<=0){s--}else{k.push(w[p]);j.push(Math.log(v[p]))}}}}for(var p=0;p<s;p++){o=o+k[p];m=m+j[p];q=q+k[p]*j[p];r=r+k[p]*k[p];l=l+j[p]*j[p]}t=(s*q-o*m)/(s*r-o*o);z=(m-t*o)/s;return[t,z]}function h(k,j){var i;i=b(k,j,"linear");return[i[0],i[1]]}function d(o,m){var k;var i=o;var n=m;k=b(i,n,"exp");var l=Math.exp(k[0]);var j=Math.exp(k[1]);return[l,j]}function c(l,j){var p=(j==null)?"linear":j;var n;var o;var r=[];var q=[];var m=[];for(k=0;k<l.length;k++){if(l[k]!=null&&l[k][0]!=null&&l[k][1]!=null){r.push(l[k][0]);q.push(l[k][1])}}if(p=="linear"){n=h(r,q);for(var k=0;k<r.length;k++){o=n[0]*r[k]+n[1];m.push([r[k],o])}}else{if(p=="exp"||p=="exponential"){n=d(r,q);for(var k=0;k<r.length;k++){o=n[1]*Math.pow(n[0],r[k]);m.push([r[k],o])}}}return{data:m,slope:n[0],intercept:n[1]}}})(jQuery);

View File

@ -1,126 +0,0 @@
Title: jqPlot Usage
Usage Documentation:
Introduction:
jqPlot is a jQuery plugin to generate pure client-side javascript charts in your web pages.
The jqPlot home page is at <http://www.jqplot.com/>.
The project page and downloads are at <http://www.bitbucket.org/cleonello/jqplot/>.
Below are a few examples to demonstrate jqPlot usage. These plots are shown as static images.
Many more examples of dynamically rendered plots can be seen on the test and examples pages here: <../../tests/>.
Include the Files:
jqPlot requires jQuery (1.4+ required for certain features). jQuery is included in the distribution.
To use jqPlot include jquery, the jqPlot jQuery plugin, jqPlot css file and optionally the excanvas
script for IE support in your web page. Note, excanvas is required only for IE versions below 9. IE 9 includes
native support for the canvas element and does not require excanvas:
> <!--[if lt IE 9]><script language="javascript" type="text/javascript" src="excanvas.js"></script><![endif]-->
> <script language="javascript" type="text/javascript" src="jquery.min.js"></script>
> <script language="javascript" type="text/javascript" src="jquery.jqplot.min.js"></script>
> <link rel="stylesheet" type="text/css" href="jquery.jqplot.css" />
Add a plot container:
Add a container (target) to your web page where you want your plot to show up.
Be sure to give your target a width and a height:
> <div id="chartdiv" style="height:400px;width:300px; "></div>
Create a plot:
Then, create the actual plot by calling the
$.jqplot plugin with the id of your target and some data:
> $.jqplot('chartdiv', [[[1, 2],[3,5.12],[5,13.1],[7,33.6],[9,85.9],[11,219.9]]]);
Which will produce a
chart like:
(see images/basicline.png)
Plot Options:
You can customize the plot by passing options to the $.jqplot function. Options are described in
<jqPlot Options> in the jqPlotOptions.txt file. An example of options usage:
> $.jqplot('chartdiv', [[[1, 2],[3,5.12],[5,13.1],[7,33.6],[9,85.9],[11,219.9]]],
> { title:'Exponential Line',
> axes:{yaxis:{min:-10, max:240}},
> series:[{color:'#5FAB78'}]
> });
Which will produce
a plot like:
(see images/basicoptions.png)
Using Plugins:
You can use jqPlot plugins (that is, plugins to the jqPlot plugin) by including them in your html
after you include the jqPlot plugin. Here is how to include the log axis plugin:
> <link rel="stylesheet" type="text/css" href="jquery.jqplot.css" />
> <!--[if IE]><script language="javascript" type="text/javascript" src="excanvas.js"></script><![endif]-->
> <script language="javascript" type="text/javascript" src="jquery.min.js"></script>
> <script language="javascript" type="text/javascript" src="jquery.jqplot.min.js"></script>
> <script language="javascript" type="text/javascript" src="jqplot.logAxisRenderer.js"></script>
Important note: For jqplot builds r529 and above (0.9.7r529 and higher), you must explicitly
enable plugins via either the { show: true } plugin option to the plot or by using
the $.jqplot.config.enablePlugins = true; config options set on the page before plot creation.
Only plugins that can be immediately active upon loading are affected. This includes
non-renderer plugins like cursor, dragable, highlighter, and trendline.
Here is the same $.jqplot call
but with a log y axis:
> $.jqplot('chartdiv', [[[1, 2],[3,5.12],[5,13.1],[7,33.6],[9,85.9],[11,219.9]]],
> { title:'Exponential Line',
> axes:{yaxis:{renderer: $.jqplot.LogAxisRenderer}},
> series:[{color:'#5FAB78'}]
> });
Which produces
a plot like:
(see images/basiclogaxis.png)
You can further customize with options specific
to the log axis plugin:
> $.jqplot('chartdiv', [[[1, 2],[3,5.12],[5,13.1],[7,33.6],[9,85.9],[11,219.9]]],
> { title:'Exponential Line',
> axes:{yaxis:{renderer: $.jqplot.LogAxisRenderer, tickDistribution:'power'}},
> series:[{color:'#5FAB78'}]
> });
Which makes a
plot like:
(see images/basiclogoptions.png)
For a full list of options, see <jqPlot Options> in the jqPlotOptions.txt file.
You can add as many plugins as you wish. Order is generally not important.
Some plugins, like the highlighter plugin which highlights data points near the
mouse, don't need any extra options or setup to function. Highlighter does have
additional options which the user can set.
Other plugins, the barRenderer for example, provide functionality that must be specified
in the chart options object. To render a series as a bar graph with the bar renderer,
you would first include the plugin after jqPlot:
> <script language="javascript" type="text/javascript" src="plugins/jqplot.barRenderer.min.js"></script>
Then you would create
a chart like:
> $.jqplot('chartdiv', [[34.53, 56.32, 25.1, 18.6]], {series:[{renderer:$.jqplot.BarRenderer}]});
Here the default LineRenderer is replaced by a BarRenderer to generate a bar graph for the first (and only) series.

File diff suppressed because one or more lines are too long

View File

@ -1,2 +0,0 @@
<?php
// Nothing to see...

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -1,4 +0,0 @@
function wp_piwik_datelink(strPage, strDate, intSite) {
window.location.href = 'index.php?page=' + strPage + '&date=' + strDate
+ '&wpmu_show_stats=' + intSite;
}

View File

@ -1,9 +0,0 @@
[main]
host = https://www.transifex.com
[wp-piwik.wp-piwik]
file_filter = wp-piwik-<lang>.po
source_file = wp-piwik.pot
source_lang = en
type = PO

View File

@ -1,5 +0,0 @@
#!/bin/bash
echo "== Fetch updated language files ===="
tx pull -a
echo "== Convert po to po ================"
for file in `find . -name "*.po"` ; do echo $file; msgfmt -v -o ${file/.po/.mo} $file ; done

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,407 +0,0 @@
# Translation of the WordPress plugin WP-Piwik 0.8.0 by Andr&eacute; Br&auml;kling.
# Copyright (C) 2010 Andr&eacute; Br&auml;kling
# This file is distributed under the same license as the WP-Piwik package.
# Andr&eacute; Br&auml;kling <webmaster@braekling.de>, 2011.
#
msgid ""
msgstr ""
"Project-Id-Version: WP-Piwik 0.8.6\n"
"Report-Msgid-Bugs-To: http://wordpress.org/tag/wp-piwik\n"
"POT-Creation-Date: 2010-07-19 18:06+0000\n"
"PO-Revision-Date: 2011-04-29 20:30+0200\n"
"Last-Translator: Harry <camanatidis@gmail.com>\n"
"Language-Team: AggelioPolis.gr\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Poedit-Language: Greek\n"
"X-Poedit-Country: GREECE\n"
#: dashboard/browsers.php:12
#: dashboard/browsers.php:33
msgid "Browser"
msgstr "Browser"
#: dashboard/browsers.php:22
#: dashboard/pages.php:43
#: dashboard/screens.php:22
#: dashboard/systems.php:22
msgid "Others"
msgstr "Άλλοι"
#: dashboard/browsers.php:34
#: dashboard/keywords.php:17
#: dashboard/pages.php:22
#: dashboard/screens.php:33
#: dashboard/systems.php:35
#: dashboard/visitors.php:53
#: dashboard/websites.php:19
#: wp-piwik.php:305
msgid "Unique"
msgstr "Μοναδικοί"
#: dashboard/browsers.php:35
#: dashboard/plugins.php:33
#: dashboard/screens.php:34
#: dashboard/systems.php:36
msgid "Percent"
msgstr "Τοις εκατό"
#: dashboard/keywords.php:12
msgid "Keywords"
msgstr "Λέξεις κλειδιά"
#: dashboard/keywords.php:17
msgid "Keyword"
msgstr "Λέξη κλειδί"
#: dashboard/overview.php:12
msgid "Overview"
msgstr "Επισκόπηση"
#: dashboard/overview.php:42
#: dashboard/visitors.php:24
msgid "Visitors"
msgstr "Επισκέπτες"
#: dashboard/overview.php:43
msgid "Unique visitors"
msgstr "Μοναδικοί επισκέπτες"
#: dashboard/overview.php:44
msgid "Page views"
msgstr "Προβολές σελίδων"
#: dashboard/overview.php:45
msgid "Max. page views in one visit"
msgstr "Ανώτατο όριο προβολών σελίδων σε μια επίσκεψη"
#: dashboard/overview.php:46
msgid "Total time spent"
msgstr "Συνολικός χρόνος"
msgid "Time/visit"
msgstr "Χρόνος/Επίσκεψη"
#: dashboard/overview.php:47
msgid "Bounce count"
msgstr "Αριθμός που εγκατέλειψαν"
#: dashboard/overview.php:49
#: wp-piwik.php:563
msgid "Shortcut"
msgstr "Συντόμευση"
#: dashboard/pages.php:13
msgid "Pages"
msgstr "Σελίδες"
#: dashboard/pages.php:21
msgid "Page"
msgstr "Σελίδα"
#: dashboard/pages.php:23
#: dashboard/plugins.php:32
#: dashboard/visitors.php:52
msgid "Visits"
msgstr "Επισκέψεις"
#: dashboard/plugins.php:12
#: dashboard/plugins.php:31
msgid "Plugins"
msgstr "Plugins"
#: dashboard/screens.php:12
#: dashboard/screens.php:32
msgid "Resolution"
msgstr "Ανάλυση"
#: dashboard/systems.php:12
#: dashboard/systems.php:34
msgid "Operating System"
msgstr "Λειτουργικό Σύστημα"
#: dashboard/visitors.php:51
msgid "Date"
msgstr "Ημερομηνία"
#: dashboard/visitors.php:54
msgid "Bounced"
msgstr "Εγκατέλειψαν"
#: dashboard/visitors.php:67
msgid "Unique TOTAL"
msgstr "Unique ΆΘΡΟΙΣΜΑ"
#: dashboard/visitors.php:67
msgid "Sum"
msgstr "Άθροισμα"
#: dashboard/visitors.php:67
msgid "Avg"
msgstr "Μέσος Όρος"
#: dashboard/websites.php:12
msgid "Websites"
msgstr "Ιστοσελίδες"
#: dashboard/websites.php:18
msgid "Website"
msgstr "Ιστοσελίδα"
#: wp-piwik.php:110
#: wp-piwik.php:365
msgid "Piwik Statistics"
msgstr "Piwik Στατιστικά"
#. #-#-#-#-# plugin.pot (WP-Piwik 0.8.0) #-#-#-#-#
#. Plugin Name of the plugin/theme
#: wp-piwik.php:111
#: wp-piwik.php:122
#: wp-piwik.php:123
#: wp-piwik.php:146
msgid "WP-Piwik"
msgstr "WP-Piwik"
#: wp-piwik.php:130
#: wp-piwik.php:131
msgid "WPMU-Piwik"
msgstr "WPMU-Piwik"
#: wp-piwik.php:142
#: wp-piwik.php:557
msgid "yesterday"
msgstr "χθες"
#: wp-piwik.php:143
#: wp-piwik.php:558
msgid "today"
msgstr "σήμερα"
#: wp-piwik.php:144
#: wp-piwik.php:559
msgid "last 30 days"
msgstr "τελευταίες 30 ημέρες"
#: wp-piwik.php:179
msgid "Settings"
msgstr "Ρυθμίσεις"
#: wp-piwik.php:381
msgid "Change"
msgstr "Αλλαγή"
#: wp-piwik.php:382
msgid "Currently shown stats:"
msgstr "Τρέχουσα προβολή στατιστικών:"
#: wp-piwik.php:383
msgid "Current shown stats: <strong>Overall</strong>"
msgstr "Τρέχουσα προβολή στατιστικών: <strong>Συνολικά</strong>"
#: wp-piwik.php:448
msgid "WP-Piwik Settings"
msgstr "WP-Piwik Ρυθμίσεις"
#: wp-piwik.php:455
#: wp-piwik.php:617
msgid "Account settings"
msgstr "Ρυθμίσεις Λογαριασμού"
#: wp-piwik.php:457
#: wp-piwik.php:619
msgid "Piwik URL"
msgstr "Piwik URL"
#: wp-piwik.php:461
#: wp-piwik.php:623
msgid "Auth token"
msgstr "Σύμβολο γνησιότητας"
#: wp-piwik.php:467
#: wp-piwik.php:628
msgid "To enable Piwik statistics, please enter your Piwik base URL (like http://mydomain.com/piwik) and your personal authentification token. You can get the token on the API page inside your Piwik interface. It looks like &quot;1234a5cd6789e0a12345b678cd9012ef&quot;."
msgstr "Για να ενεργοποιήσετε τα Piwik στατιστικά, παρακαλώ εισάγετε τη βασική Piwik URL σας (π.χ. http://mydomain.com/piwik) και τo προσωπικό σύμβολο (token) γνησιότητας. Μπορείτε να το βρείτε στη σελίδα API μέσα στη διεπαφή του Piwik. Μοιάζει με: &quot;1234a5cd6789e0a12345b678cd9012ef&quot;."
#: wp-piwik.php:477
msgid "<strong>Important note:</strong> If you do not host this blog on your own, your site admin is able to get your auth token from the database. So he is able to access your statistics. You should never use an auth token with more than simple view access!"
msgstr "<strong>Σημαντική Σημείωση:</strong> Εάν δεν φιλοξενείται το ιστολόγιο από εσάς, τότε ο διαχειριστής θα μπορεί να έχει πρόσβαση στο σύμβολο γνησιότητας (auth token) σας από τη βάση δεδομένων. Έτσι θα έχει πρόσβαση στα στατιστικά σας. Γι'αυτό το λόγο το σύμβολο γνησιότητας (auth token) δεν θα πρέπει να έχει περισσότερα δικαιώματα, παρά μόνο δικαίωμα προβολής."
#: wp-piwik.php:485
#: wp-piwik.php:489
msgid "An error occured"
msgstr "Παρουσιάστηκε σφάλμα"
#: wp-piwik.php:486
msgid "Please check URL and auth token. You need at least view access to one site."
msgstr "Παρακαλώ ελέγξτε URL και σύμβολο γνησιότητας (auth token). Απαιτείται τουλάχιστον να έχετε δικαίωμα προβολής ενός site ."
#: wp-piwik.php:492
msgid "Choose site"
msgstr "Επιλέξτε site"
#: wp-piwik.php:511
#: wp-piwik.php:547
#: wp-piwik.php:584
#: wp-piwik.php:658
msgid "Save settings"
msgstr "Αποθήκευση ρυθμίσεων"
#: wp-piwik.php:515
#: wp-piwik.php:643
msgid "Tracking settings"
msgstr "Ρυθμίσεις παρακολούθησης"
#: wp-piwik.php:521
msgid "Add script"
msgstr "Προσθήκη script"
#: wp-piwik.php:525
msgid "If your template uses wp_footer(), WP-Piwik can automatically add the Piwik javascript code to your blog."
msgstr "Αν το πρότυπό σας χρησιμοποιεί wp_footer (), το WP-Piwik μπορεί αυτόματα να προσθέσει τον Piwik javascript κώδικα στο ιστολόγιο σας."
#: wp-piwik.php:528
msgid "Track 404"
msgstr "Παρακολούθηση 404"
#: wp-piwik.php:532
msgid "If you add the Piwik javascript code by wp_footer(), WP-Piwik can automatically add a 404-category to track 404-page-visits."
msgstr "Αν προσθέσατε το Piwik javascript κώδικα μέσω wp_footer (), το WP-Piwik μπορεί αυτόματα να προσθέσει μια κατηγορία 404 για την παρακολούθηση 404 επισκέψεων."
#: wp-piwik.php:536
#: wp-piwik.php:644
msgid "Tracking filter"
msgstr "Φίλτρο Παρακολούθησης"
msgid "Choose users by user role you do <strong>not</strong> want to track."
msgstr "Επιλέξτε το ρόλο χρήστη, τον οποίο <strong>δε</strong> θέλετε να παρακολουθήσετε."
msgid "Choose users by user role you do <strong>not</strong> want to track. Requires enabled &quot;Add script&quot;-functionality."
msgstr "Επιλέξτε τους ρόλους χρηστών, τους οποίους <strong>δε</strong> θέλετε να παρακολουθήσετε. Γι'αυτό θα πρέπει να είναι ενεργοποιημένη η λειτουργία &quot;Προσθήκη script&quot;."
#: wp-piwik.php:551
msgid "Statistic view settings"
msgstr "Ρυθμίσεις Στατιστικών"
#: wp-piwik.php:554
msgid "Dashboard"
msgstr "Dashboard"
#: wp-piwik.php:556
msgid "No"
msgstr "Όχι"
#: wp-piwik.php:557
#: wp-piwik.php:558
#: wp-piwik.php:559
msgid "Yes"
msgstr "Ναι"
#: wp-piwik.php:562
msgid "Display a dashboard widget to your WordPress dashboard."
msgstr "Εμφάνιση ενός widget στο WordPress dashboard."
#: wp-piwik.php:567
msgid "Display a shortcut to Piwik itself."
msgstr "Εμφάνιση μιας συντόμευσης προς Piwik."
#: wp-piwik.php:568
msgid "Display to"
msgstr "Εμφάνιση για "
#: wp-piwik.php:579
msgid "Choose user roles allowed to see the statistics page."
msgstr "Επιλέξτε τους ρόλους χρηστών, οι οποίοι επιτρέπεται να βλέπουν τα στατιστικά."
#: wp-piwik.php:612
msgid "WPMU-Piwik Settings"
msgstr "WPMU-Piwik Ρυθμίσεις"
#: wp-piwik.php:636
msgid "<strong>Important note:</strong> You have to choose a token which provides administration access. WPMU-Piwik will create new Piwik sites for each blog if it is shown the first time and it is not added yet. All users can access their own statistics only, while site admins can access all statistics. To avoid conflicts, you should use a clean Piwik installation without other sites added. The provided themes should use wp_footer, because it adds the Piwik javascript code to each page."
msgstr "<strong>Σημαντική Σημείωση:</strong> Θα πρέπει να επιλέξετε ένα σύμβολο γνησιότητας (auth token), το οποίο θα έχει διαχειριστική πρόσβαση. Το WPMU-Piwik θα δημιουργήσει νέα Piwik sites για κάθε ιστολόγιο, εάν προβληθεί για πρώτη φορά και δεν έχει προστεθεί ακόμη. Όλοι οι χρήστες μπορούν να έχουν πρόσβαση στα δικά τους στατιστικά, ενώ οι διαχειριστές της ιστοσελίδας μπορούν να έχουν πρόσβαση σε όλες τις στατιστικές. Για την αποφυγή συγκρούσεων, θα πρέπει να χρησιμοποιήσετε μια καθαρή εγκατάσταση Piwik, χωρίς να έχετε πρoσθέσει άλλα sites. Τα παρεχόμενα πρότυπα θα πρέπει να χρησιμοποιούν wp_footer, διότι προσθέτει τον Piwik javascript κώδικα σε κάθε σελίδα."
#: wp-piwik.php:671
msgid "If you like WP-Piwik, you can support its development by a donation:"
msgstr "Αν σας αρέσει το WP-Piwik, μπορείτε να στηρίξετε την ανάπτυξή του με μια δωρεά:"
#: wp-piwik.php:687
msgid "My Amazon.de wishlist (German)"
msgstr "Η λίστα επιθυμιών μου στο Amazon.de (Γερμανικά)"
#. Plugin URI of the plugin/theme
msgid "http://www.braekling.de/wp-piwik-wpmu-piwik-wordpress/"
msgstr "http://www.braekling.de/wp-piwik-wpmu-piwik-wordpress/"
#. Description of the plugin/theme
msgid "Adds Piwik stats to your dashboard menu and Piwik code to your wordpress footer."
msgstr "Προσθέτει τα στατιστικά Piwik στο dashboard μενού και τον κώδικα Piwik στο wordpress footer."
#. Author of the plugin/theme
msgid "Andr&eacute; Br&auml;kling"
msgstr "Andr&eacute; Br&auml;kling"
#. Author URI of the plugin/theme
msgid "http://www.braekling.de"
msgstr "http://www.braekling.de"
msgid "Credits"
msgstr "Συντελεστές"
msgid "Thank you very much for your donation"
msgstr "Ευχαριστώ για τις δωρεές"
msgid "and all people flattering this"
msgstr "και σε όλους τους χρήστες που μιλούν με κολακευτικά λόγια"
msgid "Graphs powered by <a href=\"http://www.jqplot.com/\">jqPlot</a>, an open source project by Chris Leonello. Give it a try! (License: GPL 2.0 and MIT)"
msgstr "Τα γραφήματα δημιουργούνται με τη βοήθεια του <a href=\"http://www.jqplot.com/\">jqPlot</a>, ενός προγράμματος ανοιχτού κώδικα του Chris Leonello. Δοκίμασέ το! (Άδεια χρήσης: GPL 2.0 και MIT)"
msgid "Thank you very much"
msgstr "Ευχαριστώ πολύ"
msgid ", and"
msgstr " και"
msgid "for your translation work"
msgstr "για τη μετάφραση"
msgid "Thank you very much, all users who send me mails containing criticism, commendation, feature requests and bug reports! You help me to make WP-Piwik much better."
msgstr "Σας ευχαριστώ πολύ, όλους τους χρήστες που μου στείλατε μηνύματα που περιέχουν κριτική, επιδοκιμασία, αιτήματα για νέες λειτουργίες και αναφορές σφαλμάτων! Βοηθάτε να γίνει το WP-piwik πολύ καλύτερο."
msgid "Thank <strong>you</strong> for using my plugin. It is the best commendation if my piece of code is really used!"
msgstr "<strong>Σας ευχαριστώ</ strong> για τη χρήση του plugin μου. Είναι ο καλύτερος έπαινος, αν ο κώδικάς μου χρησιμοποιείται πραγματικά!"
msgid "Changes saved"
msgstr "Αλλαγές αποθηκεύτηκαν"
msgid "installed"
msgstr "εγκαταστάθηκε"
msgid "Next you should connect to Piwik"
msgstr "Στη συνέχεια συνδεθείτε με Piwik"
msgid "Please validate your configuration"
msgstr "Παρακαλώ επαληθεύστε τη διαμόρφωση"
msgid "Default date"
msgstr "Προεπιλεγμένη ημερομηνία"
msgid "Default date shown on statistics page."
msgstr "Προεπιλεγμένη ημερομηνία που αναγράφεται στη σελίδα των στατιστικών."
msgid "Dashboard data"
msgstr "Δεδομένα Dashboard"
msgid "Display an overview widget to your WordPress dashboard."
msgstr "Προβολή ενός widget προεπισκόπησης στο WordPress dashboard."
msgid "Boad chart"
msgstr "Board γράφημα"
msgid "Display a visitor graph widget to your WordPress dashboard."
msgstr "Προβολή ενός widget με γράφημα επισκεπτών στο WordPress dashboard."
msgid "No data available."
msgstr "Δεν υπάρχουν διαθέσιμα στοιχεία."

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

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