protect your blog from comment and trackback spam. It keeps your site protected from spam even while you sleep. To get started: 1) Click the "Activate" link to the left of this description, 2) Sign up for an Akismet API key, and 3) Go to your Akismet configuration page, and save your API key.
-Version: 3.0.2
+Version: 3.0.3
Author: Automattic
Author URI: http://automattic.com/wordpress-plugins/
License: GPLv2 or later
@@ -35,7 +35,7 @@ if ( !function_exists( 'add_action' ) ) {
exit;
}
-define( 'AKISMET_VERSION', '3.0.2' );
+define( 'AKISMET_VERSION', '3.0.3' );
define( 'AKISMET__MINIMUM_WP_VERSION', '3.1' );
define( 'AKISMET__PLUGIN_URL', plugin_dir_url( __FILE__ ) );
define( 'AKISMET__PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
diff --git a/wp-content/plugins/akismet/class.akismet-admin.php b/wp-content/plugins/akismet/class.akismet-admin.php
index a1c712e..b609494 100644
--- a/wp-content/plugins/akismet/class.akismet-admin.php
+++ b/wp-content/plugins/akismet/class.akismet-admin.php
@@ -327,6 +327,10 @@ class Akismet_Admin {
if ( 'approved' == $comment_status )
return;
+ if ( 'spam' == $comment_status ) {
+ return;
+ }
+
if ( function_exists('plugins_url') )
$link = add_query_arg( array( 'action' => 'akismet_recheck_queue' ), admin_url( 'admin.php' ) );
else
diff --git a/wp-content/plugins/akismet/class.akismet.php b/wp-content/plugins/akismet/class.akismet.php
index a9ab0ea..bcc5163 100644
--- a/wp-content/plugins/akismet/class.akismet.php
+++ b/wp-content/plugins/akismet/class.akismet.php
@@ -256,13 +256,31 @@ class Akismet {
public static function delete_old_comments() {
global $wpdb;
- while( $comment_ids = $wpdb->get_col( $wpdb->prepare( "SELECT comment_id FROM {$wpdb->comments} WHERE DATE_SUB(NOW(), INTERVAL 15 DAY) > comment_date_gmt AND comment_approved = 'spam' LIMIT %d", defined( 'AKISMET_DELETE_LIMIT' ) ? AKISMET_DELETE_LIMIT : 10000 ) ) ) {
+ /**
+ * Determines how many comments will be deleted in each batch.
+ *
+ * @param int The default, as defined by AKISMET_DELETE_LIMIT.
+ */
+ $delete_limit = apply_filters( 'akismet_delete_comment_limit', defined( 'AKISMET_DELETE_LIMIT' ) ? AKISMET_DELETE_LIMIT : 10000 );
+ $delete_limit = max( 1, intval( $delete_limit ) );
+
+ /**
+ * Determines how many days a comment will be left in the Spam queue before being deleted.
+ *
+ * @param int The default number of days.
+ */
+ $delete_interval = apply_filters( 'akismet_delete_comment_interval', 15 );
+ $delete_interval = max( 1, intval( $delete_interval ) );
+
+ while ( $comment_ids = $wpdb->get_col( $wpdb->prepare( "SELECT comment_id FROM {$wpdb->comments} WHERE DATE_SUB(NOW(), INTERVAL %d DAY) > comment_date_gmt AND comment_approved = 'spam' LIMIT %d", $delete_interval, $delete_limit ) ) ) {
if ( empty( $comment_ids ) )
return;
$wpdb->queries = array();
- do_action( 'delete_comment', $comment_ids );
+ foreach ( $comment_ids as $comment_id ) {
+ do_action( 'delete_comment', $comment_id );
+ }
$comma_comment_ids = implode( ', ', array_map('intval', $comment_ids) );
@@ -926,8 +944,16 @@ p {
return _http_build_query( $args, '', '&' );
}
+ /**
+ * Log debugging info to the error log.
+ *
+ * Enabled when WP_DEBUG_LOG is enabled, but can be disabled via the akismet_debug_log filter.
+ *
+ * @param mixed $akismet_debug The data to log.
+ */
public static function log( $akismet_debug ) {
- if ( defined( 'WP_DEBUG_LOG' ) && WP_DEBUG_LOG )
- error_log( print_r( compact( 'akismet_debug' ), 1 ) ); //send message to debug.log when in debug mode
+ if ( apply_filters( 'akismet_debug_log', defined( 'WP_DEBUG_LOG' ) && WP_DEBUG_LOG ) ) {
+ error_log( print_r( compact( 'akismet_debug' ), true ) );
+ }
}
}
\ No newline at end of file
diff --git a/wp-content/plugins/akismet/readme.txt b/wp-content/plugins/akismet/readme.txt
index dc13e06..2407368 100644
--- a/wp-content/plugins/akismet/readme.txt
+++ b/wp-content/plugins/akismet/readme.txt
@@ -2,8 +2,8 @@
Contributors: matt, ryan, andy, mdawaffe, tellyworth, josephscott, lessbloat, eoigal, cfinke, automattic
Tags: akismet, comments, spam
Requires at least: 3.1
-Tested up to: 3.9.2
-Stable tag: 3.0.2
+Tested up to: 4.0
+Stable tag: 3.0.3
License: GPLv2 or later
Akismet checks your comments against the Akismet Web service to see if they look like spam or not.
@@ -30,11 +30,24 @@ Upload the Akismet plugin to your blog, Activate it, then enter your [Akismet.co
== Changelog ==
+= 3.0.3 =
+*Release Date - 3rd November, 2014*
+
+* Fix for sending the wrong data to delete_comment action that could have prevented old spam comments from being deleted.
+* Added a filter to disable logging of Akismet debugging information.
+* Added a filter for the maximum comment age when deleting old spam comments.
+* Added a filter for the number per batch when deleting old spam comments.
+* Removed the "Check for Spam" button from the Spam folder.
+
= 3.0.2 =
+*Release Date - 18th August, 2014*
+
* Performance improvements.
* Fixed a bug that could truncate the comment data being sent to Akismet for checking.
= 3.0.1 =
+*Release Date - 9th July, 2014*
+
* Removed dependency on PHP's fsockopen function
* Fix spam/ham reports to work when reported outside of the WP dashboard, e.g., from Notifications or the WP app
* Remove jQuery dependency for comment form JavaScript
@@ -42,6 +55,8 @@ Upload the Akismet plugin to your blog, Activate it, then enter your [Akismet.co
* Suspended keys will now result in all comments being put in moderation, not spam.
= 3.0.0 =
+*Release Date - 15th April, 2014*
+
* Move Akismet to Settings menu
* Drop Akismet Stats menu
* Add stats snapshot to Akismet settings
@@ -55,6 +70,8 @@ Upload the Akismet plugin to your blog, Activate it, then enter your [Akismet.co
* Replace the old discard setting with a new "discard pervasive spam" feature.
= 2.6.0 =
+*Release Date - 18th March, 2014*
+
* Add ajax paging to the check for spam button to handle large volumes of comments
* Optimize javascript and add localization support
* Fix bug in link to spam comments from right now dashboard widget
@@ -63,16 +80,22 @@ Upload the Akismet plugin to your blog, Activate it, then enter your [Akismet.co
* Add pre-check for pingbacks, to stop spam before an outbound verification request is made
= 2.5.9 =
+*Release Date - 1st August, 2013*
+
* Update 'Already have a key' link to redirect page rather than depend on javascript
* Fix some non-translatable strings to be translatable
* Update Activation banner in plugins page to redirect user to Akismet config page
= 2.5.8 =
+*Release Date - 20th January, 2013*
+
* Simplify the activation process for new users
* Remove the reporter_ip parameter
* Minor preventative security improvements
= 2.5.7 =
+*Release Date - 13th December, 2012*
+
* FireFox Stats iframe preview bug
* Fix mshots preview when using https
* Add .htaccess to block direct access to files
@@ -82,6 +105,8 @@ Upload the Akismet plugin to your blog, Activate it, then enter your [Akismet.co
* Fix prepare() warnings in WP 3.5
= 2.5.6 =
+*Release Date - 26th April, 2012*
+
* Prevent retry scheduling problems on sites where wp_cron is misbehaving
* Preload mshot previews
* Modernize the widget code
@@ -93,10 +118,14 @@ Upload the Akismet plugin to your blog, Activate it, then enter your [Akismet.co
* Improve error messages when verifying an API key
= 2.5.5 =
+*Release Date - 11th January, 2012*
+
* Add nonce check for comment author URL remove action
* Fix the settings link
= 2.5.4 =
+*Release Date - 5th January, 2012*
+
* Limit Akismet CSS and Javascript loading in wp-admin to just the pages that need it
* Added author URL quick removal functionality
* Added mShot preview on Author URL hover
@@ -105,11 +134,14 @@ Upload the Akismet plugin to your blog, Activate it, then enter your [Akismet.co
* Purge old Akismet comment meta data, default of 15 days
= 2.5.3 =
+*Release Date - 8th Febuary, 2011*
+
* Specify the license is GPL v2 or later
* Fix a bug that could result in orphaned commentmeta entries
* Include hotfix for WordPress 3.0.5 filter issue
= 2.5.2 =
+*Release Date - 14th January, 2011*
* Properly format the comment count for author counts
* Look for super admins on multisite installs when looking up user roles
@@ -119,6 +151,7 @@ Upload the Akismet plugin to your blog, Activate it, then enter your [Akismet.co
* Set Akismet stats iframe height to fixed 2500px. Better to have one tall scroll bar than two side by side.
= 2.5.1 =
+*Release Date - 17th December, 2010*
* Fix a bug that caused the "Auto delete" option to fail to discard comments correctly
* Remove the comment nonce form field from the 'Akismet Configuration' page in favor of using a filter, akismet_comment_nonce
@@ -137,6 +170,7 @@ Upload the Akismet plugin to your blog, Activate it, then enter your [Akismet.co
* Hid "flagged by..." notification while on dashboard
= 2.5.0 =
+*Release Date - 7th December, 2010*
* Track comment actions under 'Akismet Status' on the edit comment screen
* Fix a few remaining deprecated function calls ( props Mike Glendinning )
@@ -152,6 +186,7 @@ Upload the Akismet plugin to your blog, Activate it, then enter your [Akismet.co
* New option, "Use a nonce on the comment form."
= 2.4.0 =
+*Release Date - 23rd August, 2010*
* Spell out that the license is GPLv2
* Fix PHP warnings
@@ -161,6 +196,7 @@ Upload the Akismet plugin to your blog, Activate it, then enter your [Akismet.co
* General code clean up
= 2.3.0 =
+*Release Date - 5th June, 2010*
* Fix "Are you sure" nonce message on config screen in WPMU
* Fix XHTML compliance issue in sidebar widget
@@ -168,10 +204,12 @@ Upload the Akismet plugin to your blog, Activate it, then enter your [Akismet.co
* Localize the widget title (core ticket #13879)
= 2.2.9 =
+*Release Date - 2nd June, 2010*
* Eliminate a potential conflict with some plugins that may cause spurious reports
= 2.2.8 =
+*Release Date - 27th May, 2010*
* Fix bug in initial comment check for ipv6 addresses
* Report comments as ham when they are moved from spam to moderation
@@ -181,12 +219,14 @@ Upload the Akismet plugin to your blog, Activate it, then enter your [Akismet.co
* Better handling of comments by logged-in users
= 2.2.7 =
+*Release Date - 17th December, 2009*
* Add a new AKISMET_VERSION constant
* Reduce the possibility of over-counting spam when another spam filter plugin is in use
* Disable the connectivity check when the API key is hard-coded for WPMU
= 2.2.6 =
+*Release Date - 20th July, 2009*
* Fix a global warning introduced in 2.2.5
* Add changelog and additional readme.txt tags
@@ -194,10 +234,12 @@ Upload the Akismet plugin to your blog, Activate it, then enter your [Akismet.co
* Support a new WPCOM_API_KEY constant for easier use with WordPress MU
= 2.2.5 =
+*Release Date - 13th July, 2009*
* Include a new Server Connectivity diagnostic check, to detect problems caused by firewalls
= 2.2.4 =
+*Release Date - 3rd June, 2009*
* Fixed a key problem affecting the stats feature in WordPress MU
* Provide additional blog information in Akismet API calls
diff --git a/wp-content/plugins/akismet/views/notice.php b/wp-content/plugins/akismet/views/notice.php
index 8a1411d..60f2e8c 100644
--- a/wp-content/plugins/akismet/views/notice.php
+++ b/wp-content/plugins/akismet/views/notice.php
@@ -40,12 +40,12 @@
-
gethostbynamel functions. Akismet cannot work correctly until this is fixed. Please contact your web host or firewall administrator and give them this information about Akismet’s system requirements.', 'akismet'), 'https://blog.akismet.com/akismet-hosting-faq/'); ?>
+
gethostbynamel functions. Akismet cannot work correctly until this is fixed. Please contact your web host or firewall administrator and give them this information about Akismet’s system requirements.', 'akismet'), 'http://blog.akismet.com/akismet-hosting-faq/'); ?>
-
our guide about firewalls.', 'akismet'), 'https://blog.akismet.com/akismet-hosting-faq/'); ?>
+
our guide about firewalls.', 'akismet'), 'http://blog.akismet.com/akismet-hosting-faq/'); ?>
@@ -99,4 +99,4 @@
upgrade to an Enterprise subscription, which covers an unlimited number of sites. Please contact our support team with any questions.', 'akismet'), 'https://akismet.com/account/upgrade/', 'https://akismet.com/contact/'); ?>
-
\ No newline at end of file
+
diff --git a/wp-content/plugins/disqus-comment-system/LICENSE b/wp-content/plugins/disqus-comment-system/LICENSE
index f171204..b0d7d44 100644
--- a/wp-content/plugins/disqus-comment-system/LICENSE
+++ b/wp-content/plugins/disqus-comment-system/LICENSE
@@ -1,674 +1,674 @@
- GNU GENERAL PUBLIC LICENSE
- Version 3, 29 June 2007
-
- Copyright (C) 2007 Free Software Foundation, Inc.
- 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.
-
- Disqus WordPress Plugin
- Copyright (C) 2010 DISQUS
-
- 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 .
-
-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:
-
- Disqus WordPress Plugin Copyright (C) 2010 DISQUS
- 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
-.
-
- 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
+ GNU GENERAL PUBLIC LICENSE
+ Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc.
+ 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.
+
+ Disqus WordPress Plugin
+ Copyright (C) 2010 Disqus
+
+ 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 .
+
+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:
+
+ Disqus WordPress Plugin Copyright (C) 2010 Disqus
+ 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
+.
+
+ 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
.
\ No newline at end of file
diff --git a/wp-content/plugins/disqus-comment-system/comments.php b/wp-content/plugins/disqus-comment-system/comments.php
index b4a74b9..14a45db 100644
--- a/wp-content/plugins/disqus-comment-system/comments.php
+++ b/wp-content/plugins/disqus-comment-system/comments.php
@@ -1,134 +1,156 @@
-Disqus Debug thread_id: ".get_post_meta($post->ID, 'dsq_thread_id', true)."";
-}
-?>
-
-
-
-
-
-
- 1 && get_option('page_comments')): // Are there comments to navigate through? ?>
-
-
← Older Comments')); ?>
-
→')); ?>
-
-
-
-
- 'dsq_comment'));
- ?>
-
-
- 1 && get_option('page_comments')): // Are there comments to navigate through? ?>
-
+
+ 1 && get_option('page_comments')): // Are there comments to navigate through? ?>
+
+
+ ←
+
+
+
+
+ →
+
+
+
+
+
+ 'dsq_comment'));
+ ?>
+
+
+ 1 && get_option('page_comments')): // Are there comments to navigate through? ?>
+
+
+ ←
+
+
+
+
+ →
+
+
+
+
+
+
+
+
+
+ array(
+ 'platform' => 'wordpress@'.$wp_version,
+ 'language' => apply_filters( 'disqus_language_filter', '' ),
+ ),
+ 'disqusIdentifier' => dsq_identifier_for_post( $post ),
+ 'disqusShortname' => strtolower( get_option( 'disqus_forum_url' ) ),
+ 'disqusTitle' => dsq_title_for_post( $post ),
+ 'disqusUrl' => get_permalink(),
+ 'options' => array(
+ 'manualSync' => get_option('disqus_manual_sync'),
+ ),
+ 'postId' => $post->ID,
+);
+
+// Add SSO vars if enabled
+$sso = dsq_sso();
+if ($sso) {
+ global $current_site;
+
+ foreach ($sso as $k=>$v) {
+ $embed_vars['disqusConfig'][$k] = $v;
+ }
+
+ $siteurl = site_url();
+ $sitename = get_bloginfo('name');
+ $embed_vars['disqusConfig']['sso'] = array(
+ 'name' => wp_specialchars_decode($sitename, ENT_QUOTES),
+ 'button' => get_option('disqus_sso_button'),
+ 'url' => $siteurl.'/wp-login.php',
+ 'logout' => $siteurl.'/wp-login.php?action=logout',
+ 'width' => '800',
+ 'height' => '700',
+ );
+}
+
+if ( get_option('dsq_external_js') == '1' ) {
+ wp_register_script( 'dsq_embed_script', plugins_url( '/media/js/disqus.js', __FILE__ ) );
+ wp_localize_script( 'dsq_embed_script', 'embedVars', $embed_vars );
+ wp_enqueue_script( 'dsq_embed_script', plugins_url( '/media/js/disqus.js', __FILE__ ) );
+}
+else {
+
+?>
+
+
+
diff --git a/wp-content/plugins/disqus-comment-system/disqus.php b/wp-content/plugins/disqus-comment-system/disqus.php
index 3b9e10f..8eee3bd 100644
--- a/wp-content/plugins/disqus-comment-system/disqus.php
+++ b/wp-content/plugins/disqus-comment-system/disqus.php
@@ -1,1583 +1,1514 @@
-
-Version: 2.77
-Author URI: http://disqus.com/
-*/
-
-/*.
- require_module 'standard';
- require_module 'pcre';
- require_module 'mysql';
-.*/
-
-require_once(dirname(__FILE__) . '/lib/wp-api.php');
-
-if (defined('DISQUS_LOCAL')) { // DISQUS defines this for local development purposes
- define('DISQUS_DOMAIN', 'dev.disqus.org:8000');
- define('DISQUS_IMPORTER_URL', 'http://dev.disqus.org:8001/');
-} else {
- define('DISQUS_DOMAIN', 'disqus.com');
- define('DISQUS_IMPORTER_URL', 'https://import.disqus.com/');
-}
-define('DISQUS_URL', 'http://' . DISQUS_DOMAIN . '/');
-define('DISQUS_MEDIA_URL', 'http://' . DISQUS_DOMAIN . '/media/');
-define('DISQUS_API_URL', 'http://' . DISQUS_DOMAIN . '/api/');
-define('DISQUS_RSS_PATH', '/latest.rss');
-define('DISQUS_CAN_EXPORT', is_file(dirname(__FILE__) . '/export.php'));
-if (!defined('DISQUS_DEBUG')) {
- define('DISQUS_DEBUG', false);
-}
-define('DISQUS_VERSION', '2.77');
-define('DISQUS_SYNC_TIMEOUT', 30);
-
-/**
- * Returns an array of all option identifiers used by DISQUS.
- * @return array[int]string
- */
-function dsq_options() {
- return array(
- '_disqus_sync_lock',
- '_disqus_sync_post_ids',
- # render disqus in the embed
- 'disqus_active',
- 'disqus_forum_url',
- 'disqus_api_key',
- 'disqus_user_api_key',
- 'disqus_replace',
- 'disqus_cc_fix',
- # SSO features
- 'disqus_partner_key',
- 'disqus_public_key',
- 'disqus_secret_key',
- 'disqus_sso_button',
- 'disqus_sso_icon',
- # disables automatic sync via cron
- 'disqus_manual_sync',
- # disables server side rendering
- 'disqus_disable_ssr',
- # the last sync comment id (from get_forum_posts)
- 'disqus_last_comment_id',
- 'disqus_version',
- );
-}
-
-/**
- * @param string $file
- * @return string
- */
-function dsq_plugin_basename($file) {
- $file = dirname($file);
-
- // From WP2.5 wp-includes/plugin.php:plugin_basename()
- $file = str_replace('\\','/',$file); // sanitize for Win32 installs
- $file = preg_replace('|/+|','/', $file); // remove any duplicate slash
- $file = preg_replace('|^.*/' . PLUGINDIR . '/|','',$file); // get relative path from plugins dir
-
- if ( strstr($file, '/') === false ) {
- return $file;
- }
-
- $pieces = explode('/', $file);
- return !empty($pieces[count($pieces)-1]) ? $pieces[count($pieces)-1] : $pieces[count($pieces)-2];
-}
-
-if ( !defined('PLUGINDIR') ) {
- define('PLUGINDIR', 'wp-content/plugins'); // Relative to ABSPATH. For back compat.
-}
-
-$mt_disqus_version = '2.01';
-/**
- * Response from Disqus get_thread API call for comments template.
- *
- * @global string $dsq_response
- * @since 1.0
- */
-$dsq_response = '';
-/**
- * Disqus API instance.
- *
- * @global string $dsq_api
- * @since 1.0
- */
-$dsq_api = new DisqusWordPressAPI(get_option('disqus_forum_url'), get_option('disqus_api_key'));
-
-/**
- * DISQUS currently unsupported dev toggle to output comments for this query.
- *
- * @global bool $DSQ_QUERY_COMMENTS
- * @since ?
- */
-$DSQ_QUERY_COMMENTS = false;
-
-/**
- * DISQUS array to store post_ids from WP_Query for comment JS output.
- *
- * @global array $DSQ_QUERY_POST_IDS
- * @since 2.2
- */
-$DSQ_QUERY_POST_IDS = array();
-
-/**
- * Helper functions.
- */
-
-/**
- * Tests if required options are configured to display the Disqus embed.
- * @return bool
- */
-function dsq_is_installed() {
- return get_option('disqus_forum_url') && get_option('disqus_api_key');
-}
-
-/**
- * @return bool
- */
-function dsq_can_replace() {
- global $id, $post;
-
- if (get_option('disqus_active') === '0'){ return false; }
-
- $replace = get_option('disqus_replace');
-
- if ( is_feed() ) { return false; }
- if ( !isset($post) ) { return false; }
- if ( 'draft' == $post->post_status ) { return false; }
- if ( !get_option('disqus_forum_url') ) { return false; }
- else if ( 'all' == $replace ) { return true; }
-
- if ( !isset($post->comment_count) ) {
- $num_comments = 0;
- } else {
- if ( 'empty' == $replace ) {
- // Only get count of comments, not including pings.
-
- // If there are comments, make sure there are comments (that are not track/pingbacks)
- if ( $post->comment_count > 0 ) {
- // Yuck, this causes a DB query for each post. This can be
- // replaced with a lighter query, but this is still not optimal.
- $comments = get_approved_comments($post->ID);
- foreach ( $comments as $comment ) {
- if ( $comment->comment_type != 'trackback' && $comment->comment_type != 'pingback' ) {
- $num_comments++;
- }
- }
- } else {
- $num_comments = 0;
- }
- }
- else {
- $num_comments = $post->comment_count;
- }
- }
-
- return ( ('empty' == $replace && 0 == $num_comments)
- || ('closed' == $replace && 'closed' == $post->comment_status) );
-}
-
-function dsq_manage_dialog($message, $error = false) {
- global $wp_version;
-
- echo '
'
- . $message
- . '
';
-}
-
-function dsq_sync_comments($comments) {
- global $wpdb;
-
- // user MUST be logged out during this process
- wp_set_current_user(0);
-
- // we need the thread_ids so we can map them to posts
- $thread_map = array();
- foreach ( $comments as $comment ) {
- $thread_map[$comment->thread->id] = null;
- }
- $thread_ids = "'" . implode("', '", array_keys($thread_map)) . "'";
-
- $results = $wpdb->get_results( "SELECT post_id, meta_value FROM $wpdb->postmeta WHERE meta_key = 'dsq_thread_id' AND meta_value IN ({$thread_ids}) LIMIT 1");
- foreach ( $results as $result ) {
- $thread_map[$result->meta_value] = $result->post_id;
- }
- unset($result);
-
- foreach ( $comments as $comment ) {
- $ts = strtotime($comment->created_at);
- if (!$thread_map[$comment->thread->id] && !empty($comment->thread->identifier)) {
- // legacy threads dont already have their meta stored
- foreach ( $comment->thread->identifier as $identifier ) {
- // we know identifier starts with post_ID
- if ($post_ID = (int)substr($identifier, 0, strpos($identifier, ' '))) {
- $thread_map[$comment->thread->id] = $post_ID;
- update_post_meta($post_ID, 'dsq_thread_id', $comment->thread->id);
- if (DISQUS_DEBUG) {
- echo "updated post {$post_ID}: dsq_thread_id set to {$comment->thread->id}\n";
- }
- }
- }
- unset($identifier);
- }
- if (!$thread_map[$comment->thread->id]) {
- // shouldn't ever happen, but we can't be certain
- if (DISQUS_DEBUG) {
- if (!empty($comment->thread->identifier)) {
- $idents = implode(', ', $comment->thread->identifier);
- echo "skipped {$comment->id}: missing thread for identifiers ({$idents})\n";
- } else {
- echo "skipped {$comment->id}: missing thread (no identifier)\n";
- }
- }
- continue;
- }
- $results = $wpdb->get_results($wpdb->prepare("SELECT comment_id FROM $wpdb->commentmeta WHERE meta_key = 'dsq_post_id' AND meta_value = %s LIMIT 1", $comment->id));
- if (count($results)) {
- // already exists
- if (DISQUS_DEBUG) {
- echo "skipped {$comment->id}: comment already exists\n";
- }
- if (count($results) > 1) {
- // clean up duplicates -- fixes an issue where a race condition allowed comments to be synced multiple times
- $results = array_slice($results, 1);
- foreach ($results as $result) {
- $wpdb->prepare("DELETE FROM $wpdb->commentmeta WHERE comment_id = %s LIMIT 1", $result);
- }
- }
- continue;
- }
-
- $commentdata = false;
-
- // first lets check by the id we have stored
- if ($comment->meta) {
- $meta = explode(';', $comment->meta);
- foreach ($meta as $value) {
- $value = explode('=', $value);
- $meta[$value[0]] = $value[1];
- }
- unset($value);
- if ($meta['wp_id']) {
- $commentdata = $wpdb->get_row($wpdb->prepare( "SELECT comment_ID, comment_parent FROM $wpdb->comments WHERE comment_ID = %s LIMIT 1", $meta['wp_id']), ARRAY_A);
- }
- }
-
- // skip comments that were imported but are missing meta information
- if (!$commentdata && $comment->imported) {
- if (DISQUS_DEBUG) {
- echo "skipped {$comment->id}: comment not found and marked as imported\n";
- }
- continue;
- }
-
- // and follow up using legacy Disqus agent
- if (!$commentdata) {
- $commentdata = $wpdb->get_row($wpdb->prepare( "SELECT comment_ID, comment_parent FROM $wpdb->comments WHERE comment_agent = %s LIMIT 1", 'Disqus/1.0:'.$comment->id), ARRAY_A);
- }
- if (!$commentdata) {
- // Comment doesnt exist yet, lets insert it
- if ($comment->status == 'approved') {
- $approved = 1;
- } elseif ($comment->status == 'spam') {
- $approved = 'spam';
- } else {
- $approved = 0;
- }
- $commentdata = array(
- 'comment_post_ID' => $thread_map[$comment->thread->id],
- 'comment_date' => date('Y-m-d\TH:i:s', strtotime($comment->created_at) + (get_option('gmt_offset') * 3600)),
- 'comment_date_gmt' => $comment->created_at,
- 'comment_content' => apply_filters('pre_comment_content', $comment->message),
- 'comment_approved' => $approved,
- 'comment_agent' => 'Disqus/1.1('.DISQUS_VERSION.'):'.intval($comment->id),
- 'comment_type' => '',
- );
- if ($comment->is_anonymous) {
- $commentdata['comment_author'] = $comment->anonymous_author->name;
- $commentdata['comment_author_email'] = $comment->anonymous_author->email;
- $commentdata['comment_author_url'] = $comment->anonymous_author->url;
- $commentdata['comment_author_IP'] = $comment->ip_address;
- } else {
- if (!empty($comment->author->display_name)) {
- $commentdata['comment_author'] = $comment->author->display_name;
- } else {
- $commentdata['comment_author'] = $comment->author->username;
- }
- $commentdata['comment_author_email'] = $comment->author->email;
- $commentdata['comment_author_url'] = $comment->author->url;
- $commentdata['comment_author_IP'] = $comment->ip_address;
- }
- $commentdata = wp_filter_comment($commentdata);
- if ($comment->parent_post) {
- $parent_id = $wpdb->get_var($wpdb->prepare( "SELECT comment_id FROM $wpdb->commentmeta WHERE meta_key = 'dsq_post_id' AND meta_value = %s LIMIT 1", $comment->parent_post));
- if ($parent_id) {
- $commentdata['comment_parent'] = $parent_id;
- }
- }
-
- // due to a race condition we need to test again for coment existance
- if ($wpdb->get_row($wpdb->prepare( "SELECT comment_id FROM $wpdb->commentmeta WHERE meta_key = 'dsq_post_id' AND meta_value = %s LIMIT 1", $comment->id))) {
- // already exists
- if (DISQUS_DEBUG) {
- echo "skipped {$comment->id}: comment already exists (second check)\n";
- }
- continue;
- }
-
- $commentdata['comment_ID'] = wp_insert_comment($commentdata);
- if (DISQUS_DEBUG) {
- echo "inserted {$comment->id}: id is {$commentdata[comment_ID]}\n";
- }
- }
- if (!$commentdata['comment_parent'] && $comment->parent_post) {
- $parent_id = $wpdb->get_var($wpdb->prepare( "SELECT comment_id FROM $wpdb->commentmeta WHERE meta_key = 'dsq_post_id' AND meta_value = %s LIMIT 1", $comment->parent_post));
- if ($parent_id) {
- $wpdb->query($wpdb->prepare( "UPDATE $wpdb->comments SET comment_parent = %s WHERE comment_id = %s", $parent_id, $commentdata['comment_ID']));
- if (DISQUS_DEBUG) {
- echo "updated {$comment->id}: comment_parent changed to {$parent_id}\n";
- }
-
- }
- }
- $comment_id = $commentdata['comment_ID'];
- update_comment_meta($comment_id, 'dsq_parent_post_id', $comment->parent_post);
- update_comment_meta($comment_id, 'dsq_post_id', $comment->id);
- }
- unset($comment);
-
- if( isset($_POST['dsq_api_key']) && $_POST['dsq_api_key'] == get_option('disqus_api_key') ) {
- if( isset($_GET['dsq_sync_action']) && isset($_GET['dsq_sync_comment_id']) ) {
- $comment_parts = explode('=', $_GET['dsq_sync_comment_id']);
-
- if (!($comment_id = intval($comment_parts[1])) > 0) {
- return;
- }
-
- if( 'wp_id' != $comment_parts[0] ) {
- $comment_id = $wpdb->get_var($wpdb->prepare('SELECT comment_ID FROM ' . $wpdb->comments . ' WHERE comment_post_ID = %d AND comment_agent LIKE %s', intval($post->ID), 'Disqus/1.0:' . $comment_id));
- }
-
- switch( $_GET['dsq_sync_action'] ) {
- case 'mark_spam':
- wp_set_comment_status($comment_id, 'spam');
- echo "";
- break;
- case 'mark_approved':
- wp_set_comment_status($comment_id, 'approve');
- echo "";
- break;
- case 'mark_killed':
- wp_set_comment_status($comment_id, 'hold');
- echo "";
- break;
- }
- }
- }
-}
-
-function dsq_request_handler() {
- global $dsq_response;
- global $dsq_api;
- global $post;
- global $wpdb;
-
- if (!empty($_GET['cf_action'])) {
- switch ($_GET['cf_action']) {
- case 'sync_comments':
- if( !( $post_id = $_GET['post_id'] ) ) {
- header("HTTP/1.0 400 Bad Request");
- die();
- }
- // schedule the event for 5 minutes from now in case they
- // happen to make a quick post
- dsq_add_pending_post_id($post_id);
-
- if (DISQUS_DEBUG) {
- $response = dsq_sync_forum();
- if (!$response) {
- die('// error: '.$dsq_api->get_last_error());
- } else {
- list($last_comment_id, $comments) = $response;
- die('// synced '.$comments.' comments');
- }
- } else {
- $ts = time() + 300;
- wp_schedule_single_event($ts, 'dsq_sync_forum');
- die('// sync scheduled');
- }
- break;
- case 'export_comments':
- if (current_user_can('manage_options') && DISQUS_CAN_EXPORT) {
- $timestamp = intval($_GET['timestamp']);
- $post_id = intval($_GET['post_id']);
- global $wpdb, $dsq_api;
- $post = $wpdb->get_results($wpdb->prepare("
- SELECT *
- FROM $wpdb->posts
- WHERE post_type != 'revision'
- AND post_status = 'publish'
- AND comment_count > 0
- AND ID > %d
- ORDER BY ID ASC
- LIMIT 1
- ", $post_id));
- $post = $post[0];
- $post_id = $post->ID;
- $max_post_id = $wpdb->get_var($wpdb->prepare("
- SELECT MAX(ID)
- FROM $wpdb->posts
- WHERE post_type != 'revision'
- AND post_status = 'publish'
- AND comment_count > 0
- ", $post_id));
- $eof = (int)($post_id == $max_post_id);
- if ($eof) {
- $status = 'complete';
- $msg = dsq_i('Your comments have been sent to Disqus and queued for import! See the status of your import at Disqus');
- }
- else {
- $status = 'partial';
- $msg = dsq_i('Processed comments on post #%s…', $post_id);
- }
- $result = 'fail';
- $response = null;
- if ($post) {
- require_once(dirname(__FILE__) . '/export.php');
- $wxr = dsq_export_wp($post);
- $response = $dsq_api->import_wordpress_comments($wxr, $timestamp, $eof);
- if (!($response['group_id'] > 0)) {
- $result = 'fail';
- $msg = '
'. dsq_i('Sorry, something unexpected happened with the export. Please try again
If your API key has changed, you may need to reinstall Disqus (deactivate the plugin and then reactivate it). If you are still having issues, refer to the WordPress help page.', 'http://disqus.com/help/wordpress'). '
';
- $response = $dsq_api->get_last_error();
- }
- else {
- if ($eof) {
- $msg = dsq_i('Your comments have been sent to Disqus and queued for import! See the status of your import at Disqus', $response['link']);
-
- }
- $result = 'success';
- }
- }
-// send AJAX response
- $response = compact('result', 'timestamp', 'status', 'post_id', 'msg', 'eof', 'response');
- header('Content-type: text/javascript');
- echo cf_json_encode($response);
- die();
- }
- break;
- case 'import_comments':
- if (current_user_can('manage_options')) {
- if (!isset($_GET['last_comment_id'])) $last_comment_id = false;
- else $last_comment_id = $_GET['last_comment_id'];
-
- if ($_GET['wipe'] == '1') {
- $wpdb->query("DELETE FROM `".$wpdb->prefix."commentmeta` WHERE meta_key IN ('dsq_post_id', 'dsq_parent_post_id')");
- $wpdb->query("DELETE FROM `".$wpdb->prefix."comments` WHERE comment_agent LIKE 'Disqus/%%'");
- }
-
- ob_start();
- $response = dsq_sync_forum($last_comment_id, true);
- $debug = ob_get_clean();
- if (!$response) {
- $status = 'error';
- $result = 'fail';
- $error = $dsq_api->get_last_error();
- $msg = '
'.dsq_i('There was an error downloading your comments from Disqus.').' '.htmlspecialchars($error).'
';
- } else {
- list($comments, $last_comment_id) = $response;
- if (!$comments) {
- $status = 'complete';
- $msg = dsq_i('Your comments have been downloaded from Disqus and saved in your local database.');
- } else {
- $status = 'partial';
- $msg = dsq_i('Import in progress (last post id: %s) …', $last_comment_id);
- }
- $result = 'success';
- }
- $debug = explode("\n", $debug);
- $response = compact('result', 'status', 'comments', 'msg', 'last_comment_id', 'debug');
- header('Content-type: text/javascript');
- echo cf_json_encode($response);
- die();
- }
- break;
- }
- }
-}
-
-add_action('init', 'dsq_request_handler');
-
-/**
- * @param string $option_name
- */
-function dsq_image_upload_handler($option_name) {
- // If the upload field has a file in it
- if(isset($_FILES[$option_name]) && ($_FILES[$option_name]['size'] > 0)) {
- // Get the type of the uploaded file. This is returned as "type/extension"
- $arr_file_type = wp_check_filetype(basename($_FILES[$option_name]['name']));
- $uploaded_file_type = $arr_file_type['type'];
- // Set an array containing a list of acceptable formats
- $allowed_file_types = array('image/jpg','image/jpeg','image/gif','image/png','image/x-icon');
- // If the uploaded file is the right format
- if(in_array($uploaded_file_type, $allowed_file_types)) {
- // Options array for the wp_handle_upload function. 'test_upload' => false
- $upload_overrides = array( 'test_form' => false );
- // Handle the upload using WP's wp_handle_upload function. Takes the posted file and an options array
- $uploaded_file = wp_handle_upload($_FILES[$option_name], $upload_overrides);
- // If the wp_handle_upload call returned a local path for the image
- if(isset($uploaded_file['url'])) {
- update_option($option_name, $uploaded_file['url']);
- }
- }
- }
-}
-
-function dsq_add_pending_post_id($post_id) {
- update_post_meta($post_id, 'dsq_needs_sync', '1', $unique=true);
-}
-
-function dsq_get_pending_post_ids() {
- global $wpdb;
-
- $results = $wpdb->get_results( "SELECT post_id FROM {$wpdb->postmeta} WHERE meta_key = 'dsq_needs_sync'");
- $post_ids = array();
- foreach ($results as $result) {
- $post_ids[] = $result->post_id;
- }
- return $post_ids;
-}
-
-function dsq_clear_pending_post_ids($post_ids) {
- global $wpdb;
-
- $post_ids_query = "'" . implode("', '", $post_ids) . "'";
- $wpdb->query("DELETE FROM {$wpdb->postmeta} WHERE meta_key = 'dsq_needs_sync' AND post_id IN ({$post_ids_query})");
-
- update_meta_cache('dsq_needs_sync', $post_ids);
-}
-
-
-function dsq_sync_post($post_id) {
- global $dsq_api, $wpdb;
-
- $post = get_post($post_id);
-
- // Call update_thread to ensure our permalink is up to date
- dsq_update_permalink($post);
-}
-
-function dsq_sync_forum($last_comment_id=false, $force=false) {
- global $dsq_api, $wpdb;
-
- set_time_limit(DISQUS_SYNC_TIMEOUT);
-
- if ($force) {
- $sync_time = null;
- } else {
- $sync_time = (int)get_option('_disqus_sync_lock');
- }
-
- // lock expires after 1 hour
- if ($sync_time && $sync_time > time() - 60*60) {
- $dsq_api->api->last_error = 'Sync already in progress (lock found)';
- return false;
- } else {
- update_option('_disqus_sync_lock', time());
- }
-
- // sync all pending posts
- $post_ids = dsq_get_pending_post_ids();
- dsq_clear_pending_post_ids($post_ids);
-
- foreach ($post_ids as $post_id) {
- dsq_sync_post($post_id);
- }
-
- if ($last_comment_id === false) {
- $last_comment_id = get_option('disqus_last_comment_id');
- if (!$last_comment_id) {
- $last_comment_id = 0;
- }
- }
- if ($last_comment_id) {
- $last_comment_id++;
- }
-
- //$last_comment_id = 0;
-
- // Pull comments from API
- $dsq_response = $dsq_api->get_forum_posts($last_comment_id);
- if( $dsq_response < 0 || $dsq_response === false ) {
- return false;
- }
-
- // Sync comments with database.
- dsq_sync_comments($dsq_response);
- $total = 0;
- if ($dsq_response) {
- foreach ($dsq_response as $comment) {
- $total += 1;
- if ($comment->id > $last_comment_id) $last_comment_id = $comment->id;
- }
- if ($last_comment_id > get_option('disqus_last_comment_id')) {
- update_option('disqus_last_comment_id', $last_comment_id);
- }
- }
- unset($comment);
- delete_option('_disqus_sync_lock');
- return array($total, $last_comment_id);
-}
-
-add_action('dsq_sync_forum', 'dsq_sync_forum');
-
-function dsq_update_permalink($post) {
- global $dsq_api;
-
- if (DISQUS_DEBUG) {
- echo "updating post on disqus: {$post->ID}\n";
- }
-
- $response = $dsq_api->api->update_thread(null, array(
- 'thread_identifier' => dsq_identifier_for_post($post),
- 'title' => dsq_title_for_post($post),
- 'url' => dsq_link_for_post($post)
- ));
-
- update_post_meta($post->ID, 'dsq_thread_id', $response->id);
-
- return $response;
-}
-
-/**
- * Compatibility
- */
-
-if (!function_exists ( '_wp_specialchars' ) ) {
-function _wp_specialchars( $string, $quote_style = ENT_NOQUOTES, $charset = false, $double_encode = false ) {
- $string = (string) $string;
-
- if ( 0 === strlen( $string ) ) {
- return '';
- }
-
- // Don't bother if there are no specialchars - saves some processing
- if ( !preg_match( '/[&<>"\']/', $string ) ) {
- return $string;
- }
-
- // Account for the previous behaviour of the function when the $quote_style is not an accepted value
- if ( empty( $quote_style ) ) {
- $quote_style = ENT_NOQUOTES;
- } elseif ( !in_array( $quote_style, array( 0, 2, 3, 'single', 'double' ), true ) ) {
- $quote_style = ENT_QUOTES;
- }
-
- // Store the site charset as a static to avoid multiple calls to wp_load_alloptions()
- if ( !$charset ) {
- static $_charset;
- if ( !isset( $_charset ) ) {
- $alloptions = wp_load_alloptions();
- $_charset = isset( $alloptions['blog_charset'] ) ? $alloptions['blog_charset'] : '';
- }
- $charset = $_charset;
- }
- if ( in_array( $charset, array( 'utf8', 'utf-8', 'UTF8' ) ) ) {
- $charset = 'UTF-8';
- }
-
- $_quote_style = $quote_style;
-
- if ( $quote_style === 'double' ) {
- $quote_style = ENT_COMPAT;
- $_quote_style = ENT_COMPAT;
- } elseif ( $quote_style === 'single' ) {
- $quote_style = ENT_NOQUOTES;
- }
-
- // Handle double encoding ourselves
- if ( !$double_encode ) {
- $string = wp_specialchars_decode( $string, $_quote_style );
- $string = preg_replace( '/&(#?x?[0-9a-z]+);/i', '|wp_entity|$1|/wp_entity|', $string );
- }
-
- $string = @htmlspecialchars( $string, $quote_style, $charset );
-
- // Handle double encoding ourselves
- if ( !$double_encode ) {
- $string = str_replace( array( '|wp_entity|', '|/wp_entity|' ), array( '&', ';' ), $string );
- }
-
- // Backwards compatibility
- if ( 'single' === $_quote_style ) {
- $string = str_replace( "'", ''', $string );
- }
-
- return $string;
-}
-}
-
-if (!function_exists ( 'wp_check_invalid_utf8' ) ) {
-function wp_check_invalid_utf8( $string, $strip = false ) {
- $string = (string) $string;
-
- if ( 0 === strlen( $string ) ) {
- return '';
- }
-
- // Store the site charset as a static to avoid multiple calls to get_option()
- static $is_utf8;
- if ( !isset( $is_utf8 ) ) {
- $is_utf8 = in_array( get_option( 'blog_charset' ), array( 'utf8', 'utf-8', 'UTF8', 'UTF-8' ) );
- }
- if ( !$is_utf8 ) {
- return $string;
- }
-
- // Check for support for utf8 in the installed PCRE library once and store the result in a static
- static $utf8_pcre;
- if ( !isset( $utf8_pcre ) ) {
- $utf8_pcre = @preg_match( '/^./u', 'a' );
- }
- // We can't demand utf8 in the PCRE installation, so just return the string in those cases
- if ( !$utf8_pcre ) {
- return $string;
- }
-
- // preg_match fails when it encounters invalid UTF8 in $string
- if ( 1 === @preg_match( '/^./us', $string ) ) {
- return $string;
- }
-
- // Attempt to strip the bad chars if requested (not recommended)
- if ( $strip && function_exists( 'iconv' ) ) {
- return iconv( 'utf-8', 'utf-8', $string );
- }
-
- return '';
-}
-}
-
-if (!function_exists ( 'esc_html' ) ) {
-function esc_html( $text ) {
- $safe_text = wp_check_invalid_utf8( $text );
- $safe_text = _wp_specialchars( $safe_text, ENT_QUOTES );
- return apply_filters( 'esc_html', $safe_text, $text );
-}
-}
-
-if (!function_exists ( 'esc_attr' ) ) {
-function esc_attr( $text ) {
- $safe_text = wp_check_invalid_utf8( $text );
- $safe_text = _wp_specialchars( $safe_text, ENT_QUOTES );
- return apply_filters( 'attribute_escape', $safe_text, $text );
-}
-}
-
-/**
- * Filters/Actions
- */
-
-// ugly global hack for comments closing
-$EMBED = false;
-function dsq_comments_template($value) {
- global $EMBED;
- global $post;
- global $comments;
-
- if ( !( is_singular() && ( have_comments() || 'open' == $post->comment_status ) ) ) {
- return;
- }
-
- if ( !dsq_is_installed() || !dsq_can_replace() ) {
- return $value;
- }
-
- // TODO: If a disqus-comments.php is found in the current template's
- // path, use that instead of the default bundled comments.php
- //return TEMPLATEPATH . '/disqus-comments.php';
- $EMBED = true;
- return dirname(__FILE__) . '/comments.php';
-}
-
-function dsq_comment( $comment, $args, $depth ) {
- $GLOBALS['comment'] = $comment;
- switch ($comment->comment_type):
- case '' :
- ?>
-
id="dsq-comment-">
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- '.$comment_text.'';
- } else {
- return $comment_text;
- }
-}
-
-function dsq_bloginfo_url($url) {
- if ( get_feed_link('comments_rss2') == $url && dsq_can_replace() ) {
- return 'https://' . strtolower(get_option('disqus_forum_url')) . '.' . DISQUS_DOMAIN . DISQUS_RSS_PATH;
- } else {
- return $url;
- }
-}
-
-function dsq_plugin_action_links($links, $file) {
- $plugin_file = basename(__FILE__);
- if (basename($file) == $plugin_file) {
- if (!dsq_is_installed()) {
- $settings_link = ''.dsq_i('Configure').'';
- } else {
- $settings_link = ''.dsq_i('Settings').'';
- }
- array_unshift($links, $settings_link);
- }
- return $links;
-}
-add_filter('plugin_action_links', 'dsq_plugin_action_links', 10, 2);
-
-/**
- * Hide the default comment form to stop spammers by marking all comments
- * as closed.
- */
-function dsq_comments_open($open, $post_id=null) {
- global $EMBED;
- if ($EMBED) return false;
- return $open;
-}
-add_filter('comments_open', 'dsq_comments_open');
-
-// Always add Disqus management page to the admin menu
-function dsq_add_pages() {
- add_submenu_page(
- 'edit-comments.php',
- 'Disqus',
- 'Disqus',
- 'moderate_comments',
- 'disqus',
- 'dsq_manage'
- );
-}
-add_action('admin_menu', 'dsq_add_pages', 10);
-
-// a little jQuery goodness to get comments menu working as desired
-function dsq_menu_admin_head() {
-?>
-
-get_results("
- SELECT comment_approved, COUNT( * ) AS num_comments
- FROM {$wpdb->comments}
- WHERE comment_type != 'trackback'
- AND comment_type != 'pingback'
- GROUP BY comment_approved
- ", ARRAY_A );
- $total = 0;
- $approved = array('0' => 'moderated', '1' => 'approved', 'spam' => 'spam');
- $known_types = array_keys( $approved );
- foreach( (array) $count as $row_num => $row ) {
- $total += $row['num_comments'];
- if ( in_array( $row['comment_approved'], $known_types ) && array_key_exists($row['comment_approved'], $approved) )
- $stats[$approved[$row['comment_approved']]] = $row['num_comments'];
- }
-
- $stats['total_comments'] = $total;
- foreach ( $approved as $key ) {
- if ( empty($stats[$key]) )
- $stats[$key] = 0;
- }
- $stats = (object) $stats;
-?>
-
-
-' type='text/css' />
-
-
-";
- }
- }
-}
-add_action('admin_head', 'dsq_admin_head');
-
-/**
- * Wrapper for built-in __() which pulls all text from
- * the disqus domain and supports variable interpolation.
- */
-function dsq_i($text, $params=null) {
- if (!is_array($params))
- {
- $params = func_get_args();
- $params = array_slice($params, 1);
- }
- return vsprintf(__($text, 'disqus'), $params);
-}
-
-// catch original query
-function dsq_parse_query($query) {
- add_action('the_posts', 'dsq_add_request_post_ids', 999);
-}
-add_action('parse_request', 'dsq_parse_query');
-
-// track the original request post_ids, only run once
-function dsq_add_request_post_ids($posts) {
- dsq_add_query_posts($posts);
- remove_action('the_posts', 'dsq_log_request_post_ids', 999);
- return $posts;
-}
-
-function dsq_maybe_add_post_ids($posts) {
- global $DSQ_QUERY_COMMENTS;
- if ($DSQ_QUERY_COMMENTS) {
- dsq_add_query_posts($posts);
- }
- return $posts;
-}
-add_action('the_posts', 'dsq_maybe_add_post_ids');
-
-function dsq_add_query_posts($posts) {
- global $DSQ_QUERY_POST_IDS;
- if (count($posts)) {
- foreach ($posts as $post) {
- $post_ids[] = intval($post->ID);
- }
- $DSQ_QUERY_POST_IDS[md5(serialize($post_ids))] = $post_ids;
- }
-}
-
-// check to see if the posts in the loop match the original request or an explicit request, if so output the JS
-function dsq_loop_end($query) {
- if ( get_option('disqus_cc_fix') == '1' || !count($query->posts) || is_single() || is_page() || is_feed() || !dsq_can_replace() ) {
- return;
- }
- global $DSQ_QUERY_POST_IDS;
- foreach ($query->posts as $post) {
- $loop_ids[] = intval($post->ID);
- }
- $posts_key = md5(serialize($loop_ids));
- if (isset($DSQ_QUERY_POST_IDS[$posts_key])) {
- dsq_output_loop_comment_js($DSQ_QUERY_POST_IDS[$posts_key]);
- }
-}
-add_action('loop_end', 'dsq_loop_end');
-
-// if someone has a better hack, let me know
-// prevents duplicate calls to count.js
-$_HAS_COUNTS = false;
-
-function dsq_output_loop_comment_js($post_ids = null) {
- global $_HAS_COUNTS;
- if ($_HAS_COUNTS) return;
- $_HAS_COUNTS = true;
- if (count($post_ids)) {
-?>
-
-
-
-post_status != 'publish') {
- return;
- }
- global $dsq_prev_permalinks;
- $dsq_prev_permalinks['post_'.$post_id] = get_permalink($post_id);
-}
-add_action('pre_post_update', 'dsq_prev_permalink');
-
-function dsq_check_permalink($post_id) {
- global $dsq_prev_permalinks;
- if (!empty($dsq_prev_permalinks['post_'.$post_id]) && $dsq_prev_permalinks['post_'.$post_id] != get_permalink($post_id)) {
- $post = get_post($post_id);
- dsq_update_permalink($post);
- }
-}
-add_action('edit_post', 'dsq_check_permalink');
-
-// Only replace comments if the disqus_forum_url option is set.
-add_filter('comments_template', 'dsq_comments_template');
-add_filter('comments_number', 'dsq_comments_text');
-add_filter('get_comments_number', 'dsq_comments_number');
-add_filter('bloginfo_url', 'dsq_bloginfo_url');
-
-/**
- * JSON ENCODE for PHP < 5.2.0
- * Checks if json_encode is not available and defines json_encode
- * to use php_json_encode in its stead
- * Works on iteratable objects as well - stdClass is iteratable, so all WP objects are gonna be iteratable
- */
-if(!function_exists('cf_json_encode')) {
- function cf_json_encode($data) {
-// json_encode is sending an application/x-javascript header on Joyent servers
-// for some unknown reason.
-// if(function_exists('json_encode')) { return json_encode($data); }
-// else { return cfjson_encode($data); }
- return cfjson_encode($data);
- }
-
- function cfjson_encode_string($str) {
- if(is_bool($str)) {
- return $str ? 'true' : 'false';
- }
-
- return str_replace(
- array(
- '"'
- , '/'
- , "\n"
- , "\r"
- )
- , array(
- '\"'
- , '\/'
- , '\n'
- , '\r'
- )
- , $str
- );
- }
-
- function cfjson_encode($arr) {
- $json_str = '';
- if (is_array($arr)) {
- $pure_array = true;
- $array_length = count($arr);
- for ( $i = 0; $i < $array_length ; $i++) {
- if (!isset($arr[$i])) {
- $pure_array = false;
- break;
- }
- }
- if ($pure_array) {
- $json_str = '[';
- $temp = array();
- for ($i=0; $i < $array_length; $i++) {
- $temp[] = sprintf("%s", cfjson_encode($arr[$i]));
- }
- $json_str .= implode(',', $temp);
- $json_str .="]";
- }
- else {
- $json_str = '{';
- $temp = array();
- foreach ($arr as $key => $value) {
- $temp[] = sprintf("\"%s\":%s", $key, cfjson_encode($value));
- }
- $json_str .= implode(',', $temp);
- $json_str .= '}';
- }
- }
- else if (is_object($arr)) {
- $json_str = '{';
- $temp = array();
- foreach ($arr as $k => $v) {
- $temp[] = '"'.$k.'":'.cfjson_encode($v);
- }
- $json_str .= implode(',', $temp);
- $json_str .= '}';
- }
- else if (is_string($arr)) {
- $json_str = '"'. cfjson_encode_string($arr) . '"';
- }
- else if (is_numeric($arr)) {
- $json_str = $arr;
- }
- else if (is_bool($arr)) {
- $json_str = $arr ? 'true' : 'false';
- }
- else {
- $json_str = '"'. cfjson_encode_string($arr) . '"';
- }
- return $json_str;
- }
-}
-
-// Single Sign-on Integration
-
-function dsq_sso() {
- if ($key = get_option('disqus_partner_key')) {
- // use old style SSO
- $new = false;
- } elseif (($key = get_option('disqus_secret_key')) && ($public = get_option('disqus_public_key'))) {
- // use new style SSO
- $new = true;
- } else {
- // sso is not configured
- return array();
- }
- global $current_user, $dsq_api;
- get_currentuserinfo();
- if ($current_user->ID) {
- $avatar_tag = get_avatar($current_user->ID);
- $avatar_data = array();
- preg_match('/(src)=((\'|")[^(\'|")]*(\'|"))/i', $avatar_tag, $avatar_data);
- $avatar = str_replace(array('"', "'"), '', $avatar_data[2]);
- $user_data = array(
- 'username' => $current_user->display_name,
- 'id' => $current_user->ID,
- 'avatar' => $avatar,
- 'email' => $current_user->user_email,
- 'url' => $current_user->user_url,
- );
- }
- else {
- $user_data = array();
- }
- $user_data = base64_encode(cf_json_encode($user_data));
- $time = time();
- $hmac = dsq_hmacsha1($user_data.' '.$time, $key);
-
- $payload = $user_data.' '.$hmac.' '.$time;
-
- if ($new) {
- return array('remote_auth_s3'=>$payload, 'api_key'=>$public);
- } else {
- return array('remote_auth_s2'=>$payload);
- }
-}
-
-function dsq_sso_login() {
- global $current_site;
- $sitename = get_bloginfo('name');
- $siteurl = site_url();
- $button = get_option('disqus_sso_button');
- $icon = get_option('disqus_sso_icon');
- $sso_login_str = 'this.sso = {
- name: "'.wp_specialchars_decode($sitename, ENT_QUOTES).'",
- button: "'.$button.'",
- icon: "'.$icon.'",
- url: "'.$siteurl.'/wp-login.php",
- logout: "'.$siteurl.'/wp-login.php?action=logout",
- width: "800",
- height: "700"
- }';
- return $sso_login_str;
-}
-
-// from: http://www.php.net/manual/en/function.sha1.php#39492
-// Calculate HMAC-SHA1 according to RFC2104
-// http://www.ietf.org/rfc/rfc2104.txt
-function dsq_hmacsha1($data, $key) {
- $blocksize=64;
- $hashfunc='sha1';
- if (strlen($key)>$blocksize)
- $key=pack('H*', $hashfunc($key));
- $key=str_pad($key,$blocksize,chr(0x00));
- $ipad=str_repeat(chr(0x36),$blocksize);
- $opad=str_repeat(chr(0x5c),$blocksize);
- $hmac = pack(
- 'H*',$hashfunc(
- ($key^$opad).pack(
- 'H*',$hashfunc(
- ($key^$ipad).$data
- )
- )
- )
- );
- return bin2hex($hmac);
-}
-
-function dsq_identifier_for_post($post) {
- return $post->ID . ' ' . $post->guid;
-}
-
-function dsq_title_for_post($post) {
- $title = get_the_title($post);
- $title = strip_tags($title, DISQUS_ALLOWED_HTML);
- return $title;
-}
-
-function dsq_link_for_post($post) {
- return get_permalink($post);
-}
-
-function dsq_does_need_update() {
- $version = (string)get_option('disqus_version');
- if (empty($version)) {
- $version = '0';
- }
-
- if (version_compare($version, '2.49', '<')) {
- return true;
- }
-
- return false;
-}
-
-function dsq_install($allow_database_install=true) {
- global $wpdb, $userdata;
-
- $version = (string)get_option('disqus_version');
- if (!$version) {
- $version = '0';
- }
-
- if ($allow_database_install)
- {
- dsq_install_database($version);
- }
-
- if (version_compare($version, DISQUS_VERSION, '=')) return;
-
- // if this is a new install, we should not set disqus active
- if ($version == '0') {
- add_option('disqus_active', '0');
- } else {
- add_option('disqus_active', '1');
- }
-
- update_option('disqus_version', DISQUS_VERSION);
-}
-
-/**
- * Adds a simple WordPress pointer to Comments menu, to remind the user to configure the plugin
- */
-function dsq_enqueue_pointer_script_style( $hook_suffix ) {
-
- // Assume pointer shouldn't be shown
- $enqueue_pointer_script_style = false;
-
- // Get array list of dismissed pointers for current user and convert it to array
- $dismissed_pointers = explode( ',', get_user_meta( get_current_user_id(), 'dismissed_wp_pointers', true ) );
-
- // Check if our pointer is not among dismissed ones
- if( !in_array( 'disqus_settings_pointer', $dismissed_pointers ) ) {
- $enqueue_pointer_script_style = true;
-
- // Add footer scripts using callback function
- add_action( 'admin_print_footer_scripts', 'dsq_pointer_print_scripts' );
- }
-
- // Enqueue pointer CSS and JS files, if needed
- if( $enqueue_pointer_script_style ) {
- wp_enqueue_style( 'wp-pointer' );
- wp_enqueue_script( 'wp-pointer' );
- }
-
-}
-if (!dsq_is_installed()) {
- // Only show the pointer when Disqus isn't already configured
- add_action( 'admin_enqueue_scripts', 'dsq_enqueue_pointer_script_style' );
-}
-
-function dsq_pointer_print_scripts() {
-
- $pointer_content = '
DISQUS needs to be configured
';
- $pointer_content .= '
Configure DISQUS by clicking Comments to the left.
';
-?>
-
-
-
-query("CREATE INDEX disqus_dupecheck ON `".$wpdb->prefix."commentmeta` (meta_key, meta_value(11));");
- }
-}
-function dsq_reset_database($version=0) {
- global $wpdb;
-
- if (version_compare($version, '2.49', '>=')) {
- $wpdb->query("DROP INDEX disqus_dupecheck ON `".$wpdb->prefix."commentmeta`;");
- }
-}
-
-/**
-* Disable internal Wordpress commenting if Disqus is enabled - this prevents spam bots from
-* commenting using POST requests to /wp-comments-post.php.
-*
-* @param int $comment_post_ID
-* @return int
-*/
-function dsq_pre_comment_on_post($comment_post_ID) {
- if (dsq_can_replace()) {
- wp_die( dsq_i('Sorry, the built-in commenting system is disabled because Disqus is active.') );
- }
- return $comment_post_ID;
-}
-add_action('pre_comment_on_post', 'dsq_pre_comment_on_post');
-
-?>
+
+Version: 2.83
+Author URI: http://disqus.com/
+*/
+
+require_once(dirname(__FILE__) . '/lib/wp-api.php');
+
+define('DISQUS_DOMAIN', 'disqus.com');
+define('DISQUS_IMPORTER_URL', 'https://import.disqus.com/');
+define('DISQUS_API_URL', 'http://disqus.com/api/');
+define('DISQUS_RSS_PATH', '/latest.rss');
+define('DISQUS_CAN_EXPORT', is_file(dirname(__FILE__) . '/export.php'));
+if (!defined('DISQUS_DEBUG')) {
+ define('DISQUS_DEBUG', false);
+}
+define('DISQUS_VERSION', '2.83');
+define('DISQUS_SYNC_TIMEOUT', 30);
+
+/**
+ * Returns an array of all option identifiers used by Disqus.
+ * @return array[int]string
+ */
+function dsq_options() {
+ return array(
+ '_disqus_sync_lock',
+ '_disqus_sync_post_ids',
+ # render disqus in the embed
+ 'disqus_active',
+ 'disqus_forum_url',
+ 'disqus_api_key',
+ 'disqus_user_api_key',
+ 'disqus_replace',
+ 'disqus_cc_fix',
+ 'dsq_external_js',
+ # SSO features
+ 'disqus_partner_key',
+ 'disqus_public_key',
+ 'disqus_secret_key',
+ 'disqus_sso_button',
+ # disables automatic sync via cron
+ 'disqus_manual_sync',
+ # disables server side rendering
+ 'disqus_disable_ssr',
+ # the last sync comment id (from get_forum_posts)
+ 'disqus_last_comment_id',
+ 'disqus_version',
+ );
+}
+
+/**
+ * @param string $file
+ * @return string
+ */
+function dsq_plugin_basename($file) {
+ $file = dirname($file);
+
+ // From WP2.5 wp-includes/plugin.php:plugin_basename()
+ $file = str_replace('\\','/',$file); // sanitize for Win32 installs
+ $file = preg_replace('|/+|','/', $file); // remove any duplicate slash
+ $file = preg_replace('|^.*/' . PLUGINDIR . '/|','',$file); // get relative path from plugins dir
+
+ if ( strstr($file, '/') === false ) {
+ return $file;
+ }
+
+ $pieces = explode('/', $file);
+ return !empty($pieces[count($pieces)-1]) ? $pieces[count($pieces)-1] : $pieces[count($pieces)-2];
+}
+
+if ( !defined('PLUGINDIR') ) {
+ define('PLUGINDIR', 'wp-content/plugins'); // Relative to ABSPATH. For back compat.
+}
+
+$mt_disqus_version = '2.01';
+/**
+ * Response from Disqus get_thread API call for comments template.
+ *
+ * @global string $dsq_response
+ * @since 1.0
+ */
+$dsq_response = '';
+/**
+ * Disqus API instance.
+ *
+ * @global string $dsq_api
+ * @since 1.0
+ */
+$dsq_api = new DisqusWordPressAPI(get_option('disqus_forum_url'), get_option('disqus_api_key'));
+
+/**
+ * Disqus currently unsupported dev toggle to output comments for this query.
+ *
+ * @global bool $DSQ_QUERY_COMMENTS
+ * @since ?
+ */
+$DSQ_QUERY_COMMENTS = false;
+
+/**
+ * Disqus array to store post_ids from WP_Query for comment JS output.
+ *
+ * @global array $DSQ_QUERY_POST_IDS
+ * @since 2.2
+ */
+$DSQ_QUERY_POST_IDS = array();
+
+/**
+ * Admin scripts
+ */
+
+add_action('wp_dashboard_setup', 'dsq_wp_dashboard_setup');
+add_action( 'admin_enqueue_scripts', 'load_admin_scripts' );
+
+function load_admin_scripts($hook) {
+
+ // Only show the pointer when Disqus isn't already configured
+ if ( dsq_is_installed() === false ) {
+ add_action( 'admin_print_footer_scripts', 'load_pointer_script_style' );
+ }
+
+ // Only load these scripts on the Disqus admin page
+ if ( 'comments_page_disqus' != $hook ) {
+ return;
+ }
+
+ $admin_vars = array(
+ 'indexUrl' => admin_url('index.php'),
+ );
+
+ wp_register_script( 'admin_script', plugins_url( '/media/js/admin.js', __FILE__ ) );
+ wp_localize_script( 'admin_script', 'adminVars', $admin_vars );
+ wp_enqueue_script( 'admin_script', plugins_url( '/media/js/admin.js', __FILE__ ), array( 'jQuery') );
+
+ wp_register_script( 'upload_script', plugins_url( '/media/js/upload.js', __FILE__) );
+ wp_enqueue_script( 'upload_script', plugins_url( '/media/js/upload.js', __FILE__), array( 'jQuery') );
+}
+
+function dsq_wp_dashboard_setup() {
+ add_action('admin_enqueue_scripts', 'load_dashboard_scripts');
+}
+
+function load_dashboard_scripts() {
+ $stats = get_dash_comment_counts();
+ $dashboard_vars = array(
+ 'stats' => array(
+ 'totalComments' => number_format($stats->total_comments),
+ 'approved' => number_format($stats->approved),
+ 'moderated' => number_format($stats->moderated),
+ 'spam' => number_format($stats->spam),
+ ),
+ );
+
+ wp_register_script( 'dashboard_script', plugins_url( '/media/js/dashboard.js', __FILE__ ) );
+ wp_localize_script( 'dashboard_script', 'dashboardVars', $dashboard_vars );
+ wp_enqueue_script( 'dashboard_script', plugins_url( '/media/js/dashboard.js', __FILE__ ), array( 'jQuery') );
+}
+
+/**
+ * Adds a simple WordPress pointer to Comments menu, to remind the user to configure the plugin
+ */
+function load_pointer_script_style() {
+
+ // Assume pointer shouldn't be shown
+ $enqueue_pointer_script_style = false;
+
+ // Get array list of dismissed pointers for current user and convert it to array
+ $dismissed_pointers = explode( ',', get_user_meta( get_current_user_id(), 'dismissed_wp_pointers', true ) );
+
+ // Check if our pointer is not among dismissed ones
+ if( !in_array( 'disqus_settings_pointer', $dismissed_pointers ) ) {
+ $enqueue_pointer_script_style = true;
+
+ // Add footer scripts using callback function
+ $pointer_content = '
'.dsq_i('Disqus needs to be configured').'
';
+ $pointer_content .= '
'.dsq_i('Configure Disqus by clicking Comments to the left.').'
';
+
+ wp_register_script( 'pointer_script', plugins_url( '/media/js/pointer.js', __FILE__ ) );
+ wp_localize_script( 'pointer_script', 'pointerContent', $pointer_content );
+ wp_enqueue_script( 'pointer_script', plugins_url( '/media/js/pointer.js', __FILE__ ), array( 'jQuery') );
+ }
+
+ // Enqueue pointer CSS and JS files, if needed
+ if( $enqueue_pointer_script_style ) {
+ wp_enqueue_style( 'wp-pointer' );
+ wp_enqueue_script( 'wp-pointer' );
+ }
+}
+
+/**
+ * Helper functions.
+ */
+
+/**
+ * Tests if site is running on Wordpress VIP
+ * @return bool
+ */
+function is_wp_vip() {
+ return defined( 'WPCOM_IS_VIP_ENV' ) && WPCOM_IS_VIP_ENV;
+}
+
+/**
+ * Tests if required options are configured to display the Disqus embed.
+ * @return bool
+ */
+function dsq_is_installed() {
+ $disqus_forum_url = get_option('disqus_forum_url');
+ $disqus_api_key = get_option('disqus_api_key');
+ if ( strlen( $disqus_forum_url ) > 0 && strlen( $disqus_api_key ) > 0 ) {
+ return true;
+ }
+ else {
+ return false;
+ }
+}
+
+/**
+ * @return bool
+ */
+function dsq_can_replace() {
+ global $id, $post;
+
+ if (get_option('disqus_active') === '0'){ return false; }
+
+ $replace = get_option('disqus_replace');
+
+ if ( is_feed() ) { return false; }
+ if ( !isset($post) ) { return false; }
+ if ( 'draft' == $post->post_status ) { return false; }
+ if ( !get_option('disqus_forum_url') ) { return false; }
+ else if ( 'all' == $replace ) { return true; }
+
+ if ( !isset($post->comment_count) ) {
+ $num_comments = 0;
+ } else {
+ if ( 'empty' == $replace ) {
+ // Only get count of comments, not including pings.
+
+ // If there are comments, make sure there are comments (that are not track/pingbacks)
+ if ( $post->comment_count > 0 ) {
+ // Yuck, this causes a DB query for each post. This can be
+ // replaced with a lighter query, but this is still not optimal.
+ $comments = get_approved_comments($post->ID);
+ foreach ( $comments as $comment ) {
+ if ( $comment->comment_type != 'trackback' && $comment->comment_type != 'pingback' ) {
+ $num_comments++;
+ }
+ }
+ } else {
+ $num_comments = 0;
+ }
+ }
+ else {
+ $num_comments = $post->comment_count;
+ }
+ }
+
+ return ( ('empty' == $replace && 0 == $num_comments)
+ || ('closed' == $replace && 'closed' == $post->comment_status) );
+}
+
+function dsq_manage_dialog($message, $error = false) {
+ global $wp_version;
+
+ echo '
'
+ . esc_attr($message)
+ . '
';
+}
+
+function dsq_sync_comments($comments) {
+ if ( count($comments) < 1 ) {
+ return;
+ }
+
+ global $wpdb;
+
+ // user MUST be logged out during this process
+ wp_set_current_user(0);
+
+ // we need the thread_ids so we can map them to posts
+ $thread_map = array();
+ foreach ( $comments as $comment ) {
+ $thread_map[$comment->thread->id] = null;
+ }
+
+ $thread_ids = array_keys($thread_map);
+
+ $threads_query = implode(', ', array_fill(0, count($thread_ids), '%s'));
+
+ // add as many placeholders as needed
+ $sql = "
+ SELECT post_id, meta_value
+ FROM $wpdb->postmeta
+ WHERE meta_key = 'dsq_thread_id' AND meta_value IN (" . $threads_query . ")
+ ";
+
+ // Call $wpdb->prepare passing the values of the array as separate arguments
+ $query = call_user_func_array(array($wpdb, 'prepare'), array_merge(array($sql), $thread_ids));
+
+ $results = $wpdb->get_results($query);
+
+ foreach ( $results as $result ) {
+ $thread_map[$result->meta_value] = $result->post_id;
+ }
+ unset($result);
+
+ foreach ( $comments as $comment ) {
+ $ts = strtotime($comment->created_at);
+ if (!$thread_map[$comment->thread->id] && !empty($comment->thread->identifier)) {
+ // legacy threads dont already have their meta stored
+ foreach ( $comment->thread->identifier as $identifier ) {
+ // we know identifier starts with post_ID
+ if ($post_ID = (int)substr($identifier, 0, strpos($identifier, ' '))) {
+ $thread_map[$comment->thread->id] = $post_ID;
+ $cleaned_thread_id = sanitize_meta( 'dsq_thread_id', $comment->thread->id, 'post' );
+ update_post_meta($post_ID, 'dsq_thread_id', $cleaned_thread_id);
+ if (DISQUS_DEBUG) {
+ echo "updated post {$post_ID}: dsq_thread_id set to {$comment->thread->id}\n";
+ }
+ }
+ }
+ unset($identifier);
+ }
+ if (!$thread_map[$comment->thread->id]) {
+ // shouldn't ever happen, but we can't be certain
+ if (DISQUS_DEBUG) {
+ if (!empty($comment->thread->identifier)) {
+ $idents = implode(', ', $comment->thread->identifier);
+ echo "skipped {$comment->id}: missing thread for identifiers ({$idents})\n";
+ } else {
+ echo "skipped {$comment->id}: missing thread (no identifier)\n";
+ }
+ }
+ continue;
+ }
+ $results = $wpdb->get_results($wpdb->prepare("SELECT comment_id FROM $wpdb->commentmeta WHERE meta_key = 'dsq_post_id' AND meta_value = %s LIMIT 1", $comment->id));
+ if (count($results)) {
+ // already exists
+ if (DISQUS_DEBUG) {
+ echo "skipped {$comment->id}: comment already exists\n";
+ }
+ if (count($results) > 1) {
+ // clean up duplicates -- fixes an issue where a race condition allowed comments to be synced multiple times
+ $results = array_slice($results, 1);
+ foreach ($results as $result) {
+ $wpdb->prepare("DELETE FROM $wpdb->commentmeta WHERE comment_id = %s LIMIT 1", $result);
+ }
+ }
+ continue;
+ }
+
+ $commentdata = false;
+
+ // first lets check by the id we have stored
+ if ($comment->meta) {
+ $meta = explode(';', $comment->meta);
+ foreach ($meta as $value) {
+ $value = explode('=', $value);
+ $meta[$value[0]] = $value[1];
+ }
+ unset($value);
+ if ($meta['wp_id']) {
+ $commentdata = $wpdb->get_row($wpdb->prepare( "SELECT comment_ID, comment_parent FROM $wpdb->comments WHERE comment_ID = %s LIMIT 1", $meta['wp_id']), ARRAY_A);
+ }
+ }
+
+ // skip comments that were imported but are missing meta information
+ if (!$commentdata && $comment->imported) {
+ if (DISQUS_DEBUG) {
+ echo "skipped {$comment->id}: comment not found and marked as imported\n";
+ }
+ continue;
+ }
+
+ // and follow up using legacy Disqus agent
+ if (!$commentdata) {
+ $commentdata = $wpdb->get_row($wpdb->prepare( "SELECT comment_ID, comment_parent FROM $wpdb->comments WHERE comment_agent = %s LIMIT 1", 'Disqus/1.0:'.$comment->id), ARRAY_A);
+ }
+ if (!$commentdata) {
+ // Comment doesnt exist yet, lets insert it
+ if ($comment->status == 'approved') {
+ $approved = 1;
+ } elseif ($comment->status == 'spam') {
+ $approved = 'spam';
+ } else {
+ $approved = 0;
+ }
+ $commentdata = array(
+ 'comment_post_ID' => $thread_map[$comment->thread->id],
+ 'comment_date' => date('Y-m-d\TH:i:s', strtotime($comment->created_at) + (get_option('gmt_offset') * 3600)),
+ 'comment_date_gmt' => $comment->created_at,
+ 'comment_content' => apply_filters('pre_comment_content', $comment->message),
+ 'comment_approved' => $approved,
+ 'comment_agent' => 'Disqus/1.1('.DISQUS_VERSION.'):'.intval($comment->id),
+ 'comment_type' => '',
+ );
+ if ($comment->is_anonymous) {
+ $commentdata['comment_author'] = $comment->anonymous_author->name;
+ $commentdata['comment_author_email'] = $comment->anonymous_author->email;
+ $commentdata['comment_author_url'] = $comment->anonymous_author->url;
+ $commentdata['comment_author_IP'] = $comment->ip_address;
+ } else {
+ if (!empty($comment->author->display_name)) {
+ $commentdata['comment_author'] = $comment->author->display_name;
+ } else {
+ $commentdata['comment_author'] = $comment->author->username;
+ }
+ $commentdata['comment_author_email'] = $comment->author->email;
+ $commentdata['comment_author_url'] = $comment->author->url;
+ $commentdata['comment_author_IP'] = $comment->ip_address;
+ }
+ $commentdata = wp_filter_comment($commentdata);
+ if ($comment->parent_post) {
+ $parent_id = $wpdb->get_var($wpdb->prepare( "SELECT comment_id FROM $wpdb->commentmeta WHERE meta_key = 'dsq_post_id' AND meta_value = %s LIMIT 1", $comment->parent_post));
+ if ($parent_id) {
+ $commentdata['comment_parent'] = $parent_id;
+ }
+ }
+
+ // due to a race condition we need to test again for coment existance
+ if ($wpdb->get_row($wpdb->prepare( "SELECT comment_id FROM $wpdb->commentmeta WHERE meta_key = 'dsq_post_id' AND meta_value = %s LIMIT 1", $comment->id))) {
+ // already exists
+ if (DISQUS_DEBUG) {
+ echo "skipped {$comment->id}: comment already exists (second check)\n";
+ }
+ continue;
+ }
+
+ $commentdata['comment_ID'] = wp_insert_comment($commentdata);
+ if (DISQUS_DEBUG) {
+ echo "inserted {$comment->id}: id is {$commentdata[comment_ID]}\n";
+ }
+ }
+ if ((isset($commentdata['comment_parent']) && !$commentdata['comment_parent']) && $comment->parent_post) {
+ $parent_id = $wpdb->get_var($wpdb->prepare( "SELECT comment_id FROM $wpdb->commentmeta WHERE meta_key = 'dsq_post_id' AND meta_value = %s LIMIT 1", $comment->parent_post));
+ if ($parent_id) {
+ $wpdb->query($wpdb->prepare( "UPDATE $wpdb->comments SET comment_parent = %s WHERE comment_id = %s", $parent_id, $commentdata['comment_ID']));
+ if (DISQUS_DEBUG) {
+ echo "updated {$comment->id}: comment_parent changed to {$parent_id}\n";
+ }
+
+ }
+ }
+ $comment_id = $commentdata['comment_ID'];
+ update_comment_meta($comment_id, 'dsq_parent_post_id', $comment->parent_post);
+ update_comment_meta($comment_id, 'dsq_post_id', $comment->id);
+ }
+ unset($comment);
+
+ if( isset($_POST['dsq_api_key']) && $_POST['dsq_api_key'] == get_option('disqus_api_key') ) {
+ if( isset($_GET['dsq_sync_action']) && isset($_GET['dsq_sync_comment_id']) ) {
+ $comment_parts = explode('=', $_GET['dsq_sync_comment_id']);
+
+ if (!($comment_id = intval($comment_parts[1])) > 0) {
+ return;
+ }
+
+ if( 'wp_id' != $comment_parts[0] ) {
+ $comment_id = $wpdb->get_var($wpdb->prepare('SELECT comment_ID FROM ' . $wpdb->comments . ' WHERE comment_post_ID = %d AND comment_agent LIKE %s', intval($post->ID), 'Disqus/1.0:' . $comment_id));
+ }
+
+ switch( $_GET['dsq_sync_action'] ) {
+ case 'mark_spam':
+ wp_set_comment_status($comment_id, 'spam');
+ echo "";
+ break;
+ case 'mark_approved':
+ wp_set_comment_status($comment_id, 'approve');
+ echo "";
+ break;
+ case 'mark_killed':
+ wp_set_comment_status($comment_id, 'hold');
+ echo "";
+ break;
+ }
+ }
+ }
+}
+
+function dsq_request_handler() {
+ global $dsq_response;
+ global $dsq_api;
+ global $post;
+ global $wpdb;
+
+ if (!empty($_GET['cf_action'])) {
+ switch ($_GET['cf_action']) {
+ case 'sync_comments':
+ if( !( $post_id = $_GET['post_id'] ) ) {
+ header("HTTP/1.0 400 Bad Request");
+ die();
+ }
+ // schedule the event for 5 minutes from now in case they
+ // happen to make a quick post
+ dsq_add_pending_post_id($post_id);
+
+ if (DISQUS_DEBUG) {
+ $response = dsq_sync_forum();
+ if (!$response) {
+ die('// error: '.$dsq_api->get_last_error());
+ } else {
+ list($last_comment_id, $comments) = $response;
+ die('// synced '.$comments.' comments');
+ }
+ } else {
+ $ts = time() + 300;
+ wp_schedule_single_event($ts, 'dsq_sync_forum');
+ die('// sync scheduled');
+ }
+ break;
+ case 'export_comments':
+ if (current_user_can('manage_options') && DISQUS_CAN_EXPORT) {
+ $msg = '';
+ $result = '';
+ $response = null;
+
+ $timestamp = intval($_GET['timestamp']);
+ $post_id = intval($_GET['post_id']);
+ if ( isset($_GET['_dsqexport_wpnonce']) === false ) {
+ $msg = dsq_i('Unable to export comments. Make sure you are accessing this page from the Wordpress dashboard.');
+ $result = 'fail';
+ }
+ else {
+
+ // Check nonce
+ check_admin_referer('dsq-wpnonce_export', '_dsqexport_wpnonce');
+
+ global $wpdb, $dsq_api;
+ $post = $wpdb->get_results($wpdb->prepare("
+ SELECT *
+ FROM $wpdb->posts
+ WHERE post_type != 'revision'
+ AND post_status = 'publish'
+ AND comment_count > 0
+ AND ID > %d
+ ORDER BY ID ASC
+ LIMIT 1
+ ", $post_id));
+ $post = $post[0];
+ $post_id = $post->ID;
+ $max_post_id = $wpdb->get_var("
+ SELECT MAX(Id)
+ FROM $wpdb->posts
+ WHERE post_type != 'revision'
+ AND post_status = 'publish'
+ AND comment_count > 0
+ ");
+ $eof = (int)($post_id == $max_post_id);
+ if ($eof) {
+ $status = 'complete';
+ $msg = dsq_i('Your comments have been sent to Disqus and queued for import!');
+ $msg .= ' ';
+ $msg .= dsq_i('See the status of your import at Disqus') . '';
+ }
+ else {
+ $status = 'partial';
+ $msg = dsq_i('Processed comments on post') . ' #'. $post_id . '…';
+ }
+ $result = 'fail';
+ if ($post) {
+ require_once(dirname(__FILE__) . '/export.php');
+ $wxr = dsq_export_wp($post);
+ $response = $dsq_api->import_wordpress_comments($wxr, $timestamp, $eof);
+ if (!($response['group_id'] > 0)) {
+ $result = 'fail';
+ $msg = '
';
+ $msg .= dsq_i('Sorry, something unexpected happened with the export. Please try again.');
+ $msg .= '
';
+ $msg .= dsq_i('If your API key has changed, you may need to reinstall Disqus (deactivate the plugin and then reactivate it).');
+ $msg .= dsq_i('If you are still having issues, refer to the %s WordPress help page',
+ '');
+ $msg .= '
';
+ $response = $dsq_api->get_last_error();
+ }
+ else {
+ if ($eof) {
+ $msg = dsq_i('Your comments have been sent to Disqus and queued for import!');
+ $msg .= ' ';
+ $msg .= dsq_i('See the status of your import at Disqus');
+ $msg .= '';
+ }
+ $result = 'success';
+ }
+ }
+ }
+
+ // send AJAX response
+ $response = compact('result', 'timestamp', 'status', 'post_id', 'msg', 'eof', 'response');
+ header('Content-type: text/javascript');
+ echo cf_json_encode($response);
+ die();
+ }
+ break;
+ case 'import_comments':
+ if (current_user_can('manage_options')) {
+ $msg = '';
+ $result = '';
+ $response = null;
+
+ if ( isset($_GET['_dsqimport_wpnonce']) === false ) {
+ $msg = dsq_i('Unable to import comments. Make sure you are accessing this page from the Wordpress dashboard.');
+ $result = 'fail';
+ }
+ else
+ {
+ // Check nonce
+ check_admin_referer('dsq-wpnonce_import', '_dsqimport_wpnonce');
+
+ if (!isset($_GET['last_comment_id'])) $last_comment_id = false;
+ else $last_comment_id = $_GET['last_comment_id'];
+
+ if ($_GET['wipe'] == '1') {
+ $wpdb->query("DELETE FROM `".$wpdb->prefix."commentmeta` WHERE meta_key IN ('dsq_post_id', 'dsq_parent_post_id')");
+ $wpdb->query("DELETE FROM `".$wpdb->prefix."comments` WHERE comment_agent LIKE 'Disqus/%%'");
+ }
+
+ ob_start();
+ $response = dsq_sync_forum($last_comment_id, true);
+ $debug = ob_get_clean();
+ if (!$response) {
+ $status = 'error';
+ $result = 'fail';
+ $error = $dsq_api->get_last_error();
+ $msg = '
'.dsq_i('There was an error downloading your comments from Disqus.').' '.esc_attr($error).'
';
+ } else {
+ list($comments, $last_comment_id) = $response;
+ if (!$comments) {
+ $status = 'complete';
+ $msg = dsq_i('Your comments have been downloaded from Disqus and saved in your local database.');
+ } else {
+ $status = 'partial';
+ $msg = dsq_i('Import in progress (last post id: %s)', $last_comment_id) . ' …';
+ }
+ $result = 'success';
+ }
+ $debug = explode("\n", $debug);
+ $response = compact('result', 'status', 'comments', 'msg', 'last_comment_id', 'debug');
+ header('Content-type: text/javascript');
+ echo cf_json_encode($response);
+ die();
+ }
+ }
+ break;
+ }
+ }
+}
+
+add_action('init', 'dsq_request_handler');
+
+/**
+ * @param string $option_name
+ */
+function dsq_image_upload_handler($option_name) {
+ // If the upload field has a file in it
+ if(isset($_FILES[$option_name]) && ($_FILES[$option_name]['size'] > 0)) {
+ // Get the type of the uploaded file. This is returned as "type/extension"
+ $arr_file_type = wp_check_filetype(basename($_FILES[$option_name]['name']));
+ $uploaded_file_type = $arr_file_type['type'];
+ // Set an array containing a list of acceptable formats
+ $allowed_file_types = array('image/jpg','image/jpeg','image/gif','image/png','image/x-icon');
+ // If the uploaded file is the right format
+ if(in_array($uploaded_file_type, $allowed_file_types)) {
+ // Options array for the wp_handle_upload function. 'test_upload' => false
+ $upload_overrides = array( 'test_form' => false );
+ // Handle the upload using WP's wp_handle_upload function. Takes the posted file and an options array
+ $uploaded_file = wp_handle_upload($_FILES[$option_name], $upload_overrides);
+ // If the wp_handle_upload call returned a local path for the image
+ if(isset($uploaded_file['url'])) {
+ update_option($option_name, $uploaded_file['url']);
+ }
+ }
+ }
+}
+
+function dsq_add_pending_post_id($post_id) {
+ update_post_meta($post_id, 'dsq_needs_sync', '1', $unique=true);
+}
+
+function dsq_get_pending_post_ids() {
+ global $wpdb;
+
+ $results = $wpdb->get_results( "SELECT post_id FROM {$wpdb->postmeta} WHERE meta_key = 'dsq_needs_sync'");
+ $post_ids = array();
+ foreach ($results as $result) {
+ $post_ids[] = $result->post_id;
+ }
+ return $post_ids;
+}
+
+function dsq_clear_pending_post_ids($post_ids) {
+ if ( count($post_ids) < 1 ) {
+ return;
+ }
+
+ global $wpdb;
+
+ $posts_query = implode(', ', array_fill(0, count($post_ids), '%s'));
+
+ // add as many placeholders as needed
+ $sql = "
+ DELETE FROM {$wpdb->postmeta}
+ WHERE meta_key = 'dsq_needs_sync' AND post_id IN (" . $posts_query . ")
+ ";
+
+ // Call $wpdb->prepare passing the values of the array as separate arguments
+ $query = call_user_func_array(array($wpdb, 'prepare'), array_merge(array($sql), $post_ids));
+
+ $wpdb->query($query);
+
+ update_meta_cache('dsq_needs_sync', $post_ids);
+}
+
+
+function dsq_sync_post($post_id) {
+ global $dsq_api, $wpdb;
+
+ $post = get_post($post_id);
+
+ // Call update_thread to ensure our permalink is up to date
+ dsq_update_permalink($post);
+}
+
+function dsq_sync_forum($last_comment_id=false, $force=false) {
+ global $dsq_api, $wpdb;
+
+ set_time_limit(DISQUS_SYNC_TIMEOUT);
+
+ if ($force) {
+ $sync_time = null;
+ } else {
+ $sync_time = (int)get_option('_disqus_sync_lock');
+ }
+
+ // lock expires after 1 hour
+ if ($sync_time && $sync_time > time() - 60*60) {
+ $dsq_api->api->last_error = 'Sync already in progress (lock found)';
+ return false;
+ } else {
+ update_option('_disqus_sync_lock', time());
+ }
+
+ // sync all pending posts
+ $post_ids = dsq_get_pending_post_ids();
+ dsq_clear_pending_post_ids($post_ids);
+
+ foreach ($post_ids as $post_id) {
+ dsq_sync_post($post_id);
+ }
+
+ if ($last_comment_id === false) {
+ $last_comment_id = get_option('disqus_last_comment_id');
+ if (!$last_comment_id) {
+ $last_comment_id = 0;
+ }
+ }
+ if ($last_comment_id) {
+ $last_comment_id++;
+ }
+
+ //$last_comment_id = 0;
+
+ // Pull comments from API
+ $dsq_response = $dsq_api->get_forum_posts($last_comment_id);
+ if( $dsq_response < 0 || $dsq_response === false ) {
+ return false;
+ }
+
+ // Sync comments with database.
+ dsq_sync_comments($dsq_response);
+ $total = 0;
+ if ($dsq_response) {
+ foreach ($dsq_response as $comment) {
+ $total += 1;
+ if ($comment->id > $last_comment_id) $last_comment_id = $comment->id;
+ }
+ if ($last_comment_id > get_option('disqus_last_comment_id')) {
+ update_option('disqus_last_comment_id', $last_comment_id);
+ }
+ }
+ unset($comment);
+ delete_option('_disqus_sync_lock');
+ return array($total, $last_comment_id);
+}
+
+add_action('dsq_sync_forum', 'dsq_sync_forum');
+
+function dsq_update_permalink($post) {
+ global $dsq_api;
+
+ if (DISQUS_DEBUG) {
+ echo "updating post on disqus: {$post->ID}\n";
+ }
+
+ $response = $dsq_api->api->update_thread(null, array(
+ 'thread_identifier' => dsq_identifier_for_post($post),
+ 'title' => dsq_title_for_post($post),
+ 'url' => dsq_link_for_post($post)
+ ));
+
+ $cleaned_thread_id = sanitize_meta( 'dsq_thread_id', $response->id, 'post' );
+ update_post_meta($post->ID, 'dsq_thread_id', $cleaned_thread_id);
+
+ return $response;
+}
+
+/**
+ * Compatibility
+ */
+
+if (!function_exists ( '_wp_specialchars' ) ) {
+function _wp_specialchars( $string, $quote_style = ENT_NOQUOTES, $charset = false, $double_encode = false ) {
+ $string = (string) $string;
+
+ if ( 0 === strlen( $string ) ) {
+ return '';
+ }
+
+ // Don't bother if there are no specialchars - saves some processing
+ if ( !preg_match( '/[&<>"\']/', $string ) ) {
+ return $string;
+ }
+
+ // Account for the previous behaviour of the function when the $quote_style is not an accepted value
+ if ( empty( $quote_style ) ) {
+ $quote_style = ENT_NOQUOTES;
+ } elseif ( !in_array( $quote_style, array( 0, 2, 3, 'single', 'double' ), true ) ) {
+ $quote_style = ENT_QUOTES;
+ }
+
+ // Store the site charset as a static to avoid multiple calls to wp_load_alloptions()
+ if ( !$charset ) {
+ static $_charset;
+ if ( !isset( $_charset ) ) {
+ $alloptions = wp_load_alloptions();
+ $_charset = isset( $alloptions['blog_charset'] ) ? $alloptions['blog_charset'] : '';
+ }
+ $charset = $_charset;
+ }
+ if ( in_array( $charset, array( 'utf8', 'utf-8', 'UTF8' ) ) ) {
+ $charset = 'UTF-8';
+ }
+
+ $_quote_style = $quote_style;
+
+ if ( $quote_style === 'double' ) {
+ $quote_style = ENT_COMPAT;
+ $_quote_style = ENT_COMPAT;
+ } elseif ( $quote_style === 'single' ) {
+ $quote_style = ENT_NOQUOTES;
+ }
+
+ // Handle double encoding ourselves
+ if ( !$double_encode ) {
+ $string = wp_specialchars_decode( $string, $_quote_style );
+ $string = preg_replace( '/&(#?x?[0-9a-z]+);/i', '|wp_entity|$1|/wp_entity|', $string );
+ }
+
+ $string = @esc_attr( $string, $quote_style, $charset );
+
+ // Handle double encoding ourselves
+ if ( !$double_encode ) {
+ $string = str_replace( array( '|wp_entity|', '|/wp_entity|' ), array( '&', ';' ), $string );
+ }
+
+ // Backwards compatibility
+ if ( 'single' === $_quote_style ) {
+ $string = str_replace( "'", ''', $string );
+ }
+
+ return $string;
+}
+}
+
+if (!function_exists ( 'wp_check_invalid_utf8' ) ) {
+function wp_check_invalid_utf8( $string, $strip = false ) {
+ $string = (string) $string;
+
+ if ( 0 === strlen( $string ) ) {
+ return '';
+ }
+
+ // Store the site charset as a static to avoid multiple calls to get_option()
+ static $is_utf8;
+ if ( !isset( $is_utf8 ) ) {
+ $is_utf8 = in_array( get_option( 'blog_charset' ), array( 'utf8', 'utf-8', 'UTF8', 'UTF-8' ) );
+ }
+ if ( !$is_utf8 ) {
+ return $string;
+ }
+
+ // Check for support for utf8 in the installed PCRE library once and store the result in a static
+ static $utf8_pcre;
+ if ( !isset( $utf8_pcre ) ) {
+ $utf8_pcre = @preg_match( '/^./u', 'a' );
+ }
+ // We can't demand utf8 in the PCRE installation, so just return the string in those cases
+ if ( !$utf8_pcre ) {
+ return $string;
+ }
+
+ // preg_match fails when it encounters invalid UTF8 in $string
+ if ( 1 === @preg_match( '/^./us', $string ) ) {
+ return $string;
+ }
+
+ // Attempt to strip the bad chars if requested (not recommended)
+ if ( $strip && function_exists( 'iconv' ) ) {
+ return iconv( 'utf-8', 'utf-8', $string );
+ }
+
+ return '';
+}
+}
+
+if (!function_exists ( 'esc_html' ) ) {
+function esc_html( $text ) {
+ $safe_text = wp_check_invalid_utf8( $text );
+ $safe_text = _wp_specialchars( $safe_text, ENT_QUOTES );
+ return apply_filters( 'esc_html', $safe_text, $text );
+}
+}
+
+if (!function_exists ( 'esc_attr' ) ) {
+function esc_attr( $text ) {
+ $safe_text = wp_check_invalid_utf8( $text );
+ $safe_text = _wp_specialchars( $safe_text, ENT_QUOTES );
+ return apply_filters( 'attribute_escape', $safe_text, $text );
+}
+}
+
+/**
+ * Filters/Actions
+ */
+
+// ugly global hack for comments closing
+$EMBED = false;
+function dsq_comments_template($value) {
+ global $EMBED;
+ global $post;
+ global $comments;
+
+ if ( !( is_singular() && ( have_comments() || 'open' == $post->comment_status ) ) ) {
+ return;
+ }
+
+ if ( !dsq_is_installed() || !dsq_can_replace() ) {
+ return $value;
+ }
+
+ // TODO: If a disqus-comments.php is found in the current template's
+ // path, use that instead of the default bundled comments.php
+ //return TEMPLATEPATH . '/disqus-comments.php';
+ $EMBED = true;
+ return dirname(__FILE__) . '/comments.php';
+}
+
+function dsq_comment( $comment, $args, $depth ) {
+ $GLOBALS['comment'] = $comment;
+ switch ($comment->comment_type):
+ case '' :
+ ?>
+
id="dsq-comment-">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
()
+
+ '.$comment_text.'';
+ } else {
+ return $comment_text;
+ }
+}
+
+function dsq_bloginfo_url($url) {
+ if ( get_feed_link('comments_rss2') == $url && dsq_can_replace() ) {
+ return 'https://' . strtolower(get_option('disqus_forum_url')) . '.disqus.com' . DISQUS_RSS_PATH;
+ } else {
+ return $url;
+ }
+}
+
+function dsq_plugin_action_links($links, $file) {
+ $plugin_file = basename(__FILE__);
+ if (basename($file) == $plugin_file) {
+ if (!dsq_is_installed()) {
+ $settings_link = ''.dsq_i('Configure').'';
+ } else {
+ $settings_link = ''.dsq_i('Settings').'';
+ }
+ array_unshift($links, $settings_link);
+ }
+ return $links;
+}
+add_filter('plugin_action_links', 'dsq_plugin_action_links', 10, 2);
+
+/**
+ * Hide the default comment form to stop spammers by marking all comments
+ * as closed.
+ */
+function dsq_comments_open($open, $post_id=null) {
+ global $EMBED;
+ if ($EMBED) return false;
+ return $open;
+}
+add_filter('comments_open', 'dsq_comments_open');
+
+// Always add Disqus management page to the admin menu
+function dsq_add_pages() {
+ add_submenu_page(
+ 'edit-comments.php',
+ 'Disqus',
+ 'Disqus',
+ 'moderate_comments',
+ 'disqus',
+ 'dsq_manage'
+ );
+}
+add_action('admin_menu', 'dsq_add_pages', 10);
+
+// only active on dashboard
+function get_dash_comment_counts() {
+ global $wpdb;
+// taken from wp-includes/comment.php - WP 2.8.5
+ $count = $wpdb->get_results("
+ SELECT comment_approved, COUNT( * ) AS num_comments
+ FROM {$wpdb->comments}
+ WHERE comment_type != 'trackback'
+ AND comment_type != 'pingback'
+ GROUP BY comment_approved
+ ", ARRAY_A );
+ $total = 0;
+ $approved = array('0' => 'moderated', '1' => 'approved', 'spam' => 'spam');
+ $known_types = array_keys( $approved );
+ foreach( (array) $count as $row_num => $row ) {
+ $total += $row['num_comments'];
+ if ( in_array( $row['comment_approved'], $known_types ) && array_key_exists($row['comment_approved'], $approved) )
+ $stats[$approved[$row['comment_approved']]] = $row['num_comments'];
+ }
+
+ $stats['total_comments'] = $total;
+ foreach ( $approved as $key ) {
+ if ( empty($stats[$key]) )
+ $stats[$key] = 0;
+ }
+ return (object) $stats;
+}
+
+function dsq_manage() {
+ if (dsq_does_need_update() && isset($_POST['upgrade'])) {
+ dsq_install();
+ }
+
+ if (dsq_does_need_update() && !isset($_POST['reset'])) {
+ include_once(dirname(__FILE__) . '/upgrade.php');
+ } else {
+ include_once(dirname(__FILE__) . '/manage.php');
+ }
+}
+
+function dsq_admin_head() {
+ if (isset($_GET['page']) && $_GET['page'] == 'disqus') {
+?>
+' type='text/css' />
+
+";
+ }
+ }
+}
+add_action('admin_head', 'dsq_admin_head');
+
+/**
+ * Wrapper for built-in __() which pulls all text from
+ * the disqus domain and supports variable interpolation.
+ */
+function dsq_i($text, $params=null) {
+ if (!is_array($params))
+ {
+ $params = func_get_args();
+ $params = array_slice($params, 1);
+ }
+ return vsprintf(__($text, 'disqus'), $params);
+}
+
+// catch original query
+function dsq_parse_query($query) {
+ add_action('the_posts', 'dsq_add_request_post_ids', 999);
+}
+add_action('parse_request', 'dsq_parse_query');
+
+// track the original request post_ids, only run once
+function dsq_add_request_post_ids($posts) {
+ dsq_add_query_posts($posts);
+ remove_action('the_posts', 'dsq_log_request_post_ids', 999);
+ return $posts;
+}
+
+function dsq_maybe_add_post_ids($posts) {
+ global $DSQ_QUERY_COMMENTS;
+ if ($DSQ_QUERY_COMMENTS) {
+ dsq_add_query_posts($posts);
+ }
+ return $posts;
+}
+add_action('the_posts', 'dsq_maybe_add_post_ids');
+
+function dsq_add_query_posts($posts) {
+ global $DSQ_QUERY_POST_IDS;
+ if (count($posts)) {
+ foreach ($posts as $post) {
+ $post_ids[] = intval($post->ID);
+ }
+ $DSQ_QUERY_POST_IDS[md5(serialize($post_ids))] = $post_ids;
+ }
+}
+
+function dsq_output_count_js() {
+ if ( get_option('dsq_external_js') == '1' ) {
+ $count_vars = array(
+ 'disqusShortname' => strtolower( get_option( 'disqus_forum_url' ) ),
+ );
+
+ wp_register_script( 'dsq_count_script', plugins_url( '/media/js/count.js', __FILE__ ) );
+ wp_localize_script( 'dsq_count_script', 'countVars', $count_vars );
+ wp_enqueue_script( 'dsq_count_script', plugins_url( '/media/js/count.js', __FILE__ ) );
+ }
+ else {
+ ?>
+
+ post_status != 'publish') {
+ return;
+ }
+ global $dsq_prev_permalinks;
+ $dsq_prev_permalinks['post_'.$post_id] = get_permalink($post_id);
+}
+add_action('pre_post_update', 'dsq_prev_permalink');
+
+function dsq_check_permalink($post_id) {
+ global $dsq_prev_permalinks;
+ if (!empty($dsq_prev_permalinks['post_'.$post_id]) &&
+ $dsq_prev_permalinks['post_'.$post_id] != get_permalink($post_id)
+ ) {
+ $post = get_post($post_id);
+ dsq_update_permalink($post);
+ }
+}
+add_action('edit_post', 'dsq_check_permalink');
+
+// Only replace comments if the disqus_forum_url option is set.
+add_filter('comments_template', 'dsq_comments_template');
+add_filter('comments_number', 'dsq_comments_text');
+add_filter('get_comments_number', 'dsq_comments_number');
+add_filter('bloginfo_url', 'dsq_bloginfo_url');
+
+/**
+ * JSON ENCODE for PHP < 5.2.0
+ * Checks if json_encode is not available and defines json_encode
+ * to use php_json_encode in its stead
+ * Works on iteratable objects as well - stdClass is iteratable, so all WP objects are gonna be iteratable
+ */
+if(!function_exists('cf_json_encode')) {
+ function cf_json_encode($data) {
+
+ // json_encode is sending an application/x-javascript header on Joyent servers
+ // for some unknown reason.
+ return cfjson_encode($data);
+ }
+
+ function cfjson_encode_string($str) {
+ if(is_bool($str)) {
+ return $str ? 'true' : 'false';
+ }
+
+ return str_replace(
+ array(
+ '"'
+ , '/'
+ , "\n"
+ , "\r"
+ )
+ , array(
+ '\"'
+ , '\/'
+ , '\n'
+ , '\r'
+ )
+ , $str
+ );
+ }
+
+ function cfjson_encode($arr) {
+ $json_str = '';
+ if (is_array($arr)) {
+ $pure_array = true;
+ $array_length = count($arr);
+ for ( $i = 0; $i < $array_length ; $i++) {
+ if (!isset($arr[$i])) {
+ $pure_array = false;
+ break;
+ }
+ }
+ if ($pure_array) {
+ $json_str = '[';
+ $temp = array();
+ for ($i=0; $i < $array_length; $i++) {
+ $temp[] = sprintf("%s", cfjson_encode($arr[$i]));
+ }
+ $json_str .= implode(',', $temp);
+ $json_str .="]";
+ }
+ else {
+ $json_str = '{';
+ $temp = array();
+ foreach ($arr as $key => $value) {
+ $temp[] = sprintf("\"%s\":%s", $key, cfjson_encode($value));
+ }
+ $json_str .= implode(',', $temp);
+ $json_str .= '}';
+ }
+ }
+ else if (is_object($arr)) {
+ $json_str = '{';
+ $temp = array();
+ foreach ($arr as $k => $v) {
+ $temp[] = '"'.$k.'":'.cfjson_encode($v);
+ }
+ $json_str .= implode(',', $temp);
+ $json_str .= '}';
+ }
+ else if (is_string($arr)) {
+ $json_str = '"'. cfjson_encode_string($arr) . '"';
+ }
+ else if (is_numeric($arr)) {
+ $json_str = $arr;
+ }
+ else if (is_bool($arr)) {
+ $json_str = $arr ? 'true' : 'false';
+ }
+ else {
+ $json_str = '"'. cfjson_encode_string($arr) . '"';
+ }
+ return $json_str;
+ }
+}
+
+// Single Sign-on Integration
+
+function dsq_sso_login() {
+ global $current_site;
+ $sitename = get_bloginfo('name');
+ $siteurl = site_url();
+ $button = get_option('disqus_sso_button');
+ $sso_login_str = 'this.sso = {
+ name: "' . esc_js( $sitename ) . '",
+ button: "' . $button . '",
+ url: "' . $siteurl . '/wp-login.php",
+ logout: "' . $siteurl . '/wp-login.php?action=logout",
+ width: "800",
+ height: "700"
+ };';
+ return $sso_login_str;
+}
+
+function dsq_sso() {
+ if ($key = get_option('disqus_partner_key')) {
+ // use old style SSO
+ $new = false;
+ } elseif (($key = get_option('disqus_secret_key')) && ($public = get_option('disqus_public_key'))) {
+ // use new style SSO
+ $new = true;
+ } else {
+ // sso is not configured
+ return array();
+ }
+ global $current_user, $dsq_api;
+ get_currentuserinfo();
+ if ($current_user->ID) {
+ $avatar_tag = get_avatar($current_user->ID);
+ $avatar_data = array();
+ preg_match('/(src)=((\'|")[^(\'|")]*(\'|"))/i', $avatar_tag, $avatar_data);
+ $avatar = str_replace(array('"', "'"), '', $avatar_data[2]);
+ $user_data = array(
+ 'username' => $current_user->display_name,
+ 'id' => $current_user->ID,
+ 'avatar' => $avatar,
+ 'email' => $current_user->user_email,
+ 'url' => $current_user->user_url,
+ );
+ }
+ else {
+ $user_data = array();
+ }
+ $user_data = base64_encode(cf_json_encode($user_data));
+ $time = time();
+ $hmac = dsq_hmacsha1($user_data.' '.$time, $key);
+
+ $payload = $user_data.' '.$hmac.' '.$time;
+
+ if ($new) {
+ return array('remote_auth_s3'=>$payload, 'api_key'=>$public);
+ } else {
+ return array('remote_auth_s2'=>$payload);
+ }
+}
+
+// from: http://www.php.net/manual/en/function.sha1.php#39492
+// Calculate HMAC-SHA1 according to RFC2104
+// http://www.ietf.org/rfc/rfc2104.txt
+function dsq_hmacsha1($data, $key) {
+ $blocksize=64;
+ $hashfunc='sha1';
+ if (strlen($key)>$blocksize)
+ $key=pack('H*', $hashfunc($key));
+ $key=str_pad($key,$blocksize,chr(0x00));
+ $ipad=str_repeat(chr(0x36),$blocksize);
+ $opad=str_repeat(chr(0x5c),$blocksize);
+ $hmac = pack(
+ 'H*',$hashfunc(
+ ($key^$opad).pack(
+ 'H*',$hashfunc(
+ ($key^$ipad).$data
+ )
+ )
+ )
+ );
+ return bin2hex($hmac);
+}
+
+function dsq_identifier_for_post($post) {
+ return $post->ID . ' ' . $post->guid;
+}
+
+function dsq_title_for_post($post) {
+ $title = get_the_title($post);
+ $title = strip_tags($title, DISQUS_ALLOWED_HTML);
+ return $title;
+}
+
+function dsq_link_for_post($post) {
+ return get_permalink($post);
+}
+
+function dsq_does_need_update() {
+ $version = (string)get_option('disqus_version');
+ if (empty($version)) {
+ $version = '0';
+ }
+
+ if (version_compare($version, '2.49', '<')) {
+ return true;
+ }
+
+ return false;
+}
+
+function dsq_install($allow_database_install=true) {
+ global $wpdb, $userdata;
+
+ $version = (string)get_option('disqus_version');
+ if (!$version) {
+ $version = '0';
+ }
+
+ if ($allow_database_install)
+ {
+ dsq_install_database($version);
+ }
+
+ if (version_compare($version, DISQUS_VERSION, '=')) return;
+
+ // if this is a new install, we should not set disqus active
+ if ($version == '0') {
+ add_option('disqus_active', '0');
+ } else {
+ add_option('disqus_active', '1');
+ }
+
+ update_option('disqus_version', DISQUS_VERSION);
+}
+
+/**
+ * Initializes the database if it's not already present.
+ */
+function dsq_install_database($version=0) {
+ global $wpdb;
+
+ if ( version_compare($version, '2.49', '<') && !is_wp_vip() ) {
+ $wpdb->query("CREATE INDEX disqus_dupecheck ON `".$wpdb->prefix."commentmeta` (meta_key, meta_value(11));");
+ }
+}
+function dsq_reset_database($version=0) {
+ global $wpdb;
+
+ if ( version_compare($version, '2.49', '>=') && !is_wp_vip() ) {
+ $wpdb->query("DROP INDEX disqus_dupecheck ON `".$wpdb->prefix."commentmeta`;");
+ }
+}
+
+/**
+* Disable internal Wordpress commenting if Disqus is enabled - this prevents spam bots from
+* commenting using POST requests to /wp-comments-post.php.
+*
+* @param int $comment_post_ID
+* @return int
+*/
+function dsq_pre_comment_on_post($comment_post_ID) {
+ if (dsq_can_replace()) {
+ wp_die( dsq_i('Sorry, the built-in commenting system is disabled because Disqus is active.') );
+ }
+ return $comment_post_ID;
+}
+add_action('pre_comment_on_post', 'dsq_pre_comment_on_post');
+
+?>
diff --git a/wp-content/plugins/disqus-comment-system/export.php b/wp-content/plugins/disqus-comment-system/export.php
index 7f8aa59..ada8680 100644
--- a/wp-content/plugins/disqus-comment-system/export.php
+++ b/wp-content/plugins/disqus-comment-system/export.php
@@ -1,195 +1,195 @@
-term_id] = $category->parent;
-
- $parents = array_unique(array_diff($parents, array_keys($parents)));
-
- if ( $zero = array_search('0', $parents) )
- unset($parents[$zero]);
-
- return $parents;
-}
-
-/**
- * Place string in CDATA tag.
- *
- * @since unknown
- *
- * @param string $str String to place in XML CDATA tag.
- */
-function dsq_export_wxr_cdata($str) {
- if ( seems_utf8($str) == false )
- $str = utf8_encode($str);
-
- // $str = ent2ncr(esc_html($str));
-
- $str = '', ']]]]>', $str ) . ']]>';
-
- return $str;
-}
-
-/**
- * {@internal Missing Short Description}}
- *
- * @since unknown
- *
- * @return string Site URL.
- */
-function dsq_export_wxr_site_url() {
- global $current_site;
-
- // mu: the base url
- if ( isset($current_site->domain) ) {
- return 'http://'.$current_site->domain.$current_site->path;
- }
- // wp: the blog url
- else {
- return get_bloginfo_rss('url');
- }
-}
-
-/**
- * {@internal Missing Short Description}}
- *
- * @since unknown
- *
- * @param object $c Category Object
- */
-function dsq_export_wxr_cat_name($c) {
- if ( empty($c->name) )
- return;
-
- echo '' . dsq_export_wxr_cdata($c->name) . '';
-}
-
-/**
- * {@internal Missing Short Description}}
- *
- * @since unknown
- *
- * @param object $c Category Object
- */
-function dsq_export_wxr_category_description($c) {
- if ( empty($c->description) )
- return;
-
- echo '' . dsq_export_wxr_cdata($c->description) . '';
-}
-
-/**
- * {@internal Missing Short Description}}
- *
- * @since unknown
- *
- * @param object $t Tag Object
- */
-function dsq_export_wxr_tag_name($t) {
- if ( empty($t->name) )
- return;
-
- echo '' . dsq_export_wxr_cdata($t->name) . '';
-}
-
-/**
- * {@internal Missing Short Description}}
- *
- * @since unknown
- *
- * @param object $t Tag Object
- */
-function dsq_export_wxr_tag_description($t) {
- if ( empty($t->description) )
- return;
-
- echo '' . dsq_export_wxr_cdata($t->description) . '';
-}
-
-// receives an array of posts to export
-function dsq_export_wp($post, $comments=null) {
- global $wpdb;
-
- if (!$comments) {
- $comments = $wpdb->get_results( $wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d AND comment_agent NOT LIKE 'Disqus/%%'", $post->ID) );
- }
-
- // start catching output
- ob_start();
-
- echo '\n";
-?>
-
-
-
-
-
-
-
- WordPress ; Disqus
-in_the_loop = true; // Fake being in the loop.
-setup_postdata($post); ?>
-
-post_title); ?>
-
-
-
-
-post_content) ); ?>
-
-ID; ?>
-post_date_gmt; ?>
-comment_status; ?>
-
-
-comment_ID; ?>
-comment_author); ?>
-comment_author_email; ?>
-comment_author_url; ?>
-comment_author_IP; ?>
-comment_date; ?>
-comment_date_gmt; ?>
-comment_content) ?>
-comment_approved; ?>
-comment_type; ?>
-comment_parent; ?>
-
-
-
-
-
-
+term_id] = $category->parent;
+
+ $parents = array_unique(array_diff($parents, array_keys($parents)));
+
+ if ( $zero = array_search('0', $parents) )
+ unset($parents[$zero]);
+
+ return $parents;
+}
+
+/**
+ * Place string in CDATA tag.
+ *
+ * @since unknown
+ *
+ * @param string $str String to place in XML CDATA tag.
+ */
+function dsq_export_wxr_cdata($str) {
+ if ( seems_utf8($str) == false )
+ $str = utf8_encode($str);
+
+ // $str = ent2ncr(esc_html($str));
+
+ $str = '', ']]]]>', $str ) . ']]>';
+
+ return $str;
+}
+
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @return string Site URL.
+ */
+function dsq_export_wxr_site_url() {
+ global $current_site;
+
+ // mu: the base url
+ if ( isset($current_site->domain) ) {
+ return 'http://'.$current_site->domain.$current_site->path;
+ }
+ // wp: the blog url
+ else {
+ return get_bloginfo_rss('url');
+ }
+}
+
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @param object $c Category Object
+ */
+function dsq_export_wxr_cat_name($c) {
+ if ( empty($c->name) )
+ return;
+
+ echo '' . dsq_export_wxr_cdata($c->name) . '';
+}
+
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @param object $c Category Object
+ */
+function dsq_export_wxr_category_description($c) {
+ if ( empty($c->description) )
+ return;
+
+ echo '' . dsq_export_wxr_cdata($c->description) . '';
+}
+
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @param object $t Tag Object
+ */
+function dsq_export_wxr_tag_name($t) {
+ if ( empty($t->name) )
+ return;
+
+ echo '' . dsq_export_wxr_cdata($t->name) . '';
+}
+
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @param object $t Tag Object
+ */
+function dsq_export_wxr_tag_description($t) {
+ if ( empty($t->description) )
+ return;
+
+ echo '' . dsq_export_wxr_cdata($t->description) . '';
+}
+
+// receives an array of posts to export
+function dsq_export_wp($post, $comments=null) {
+ global $wpdb;
+
+ if (!$comments) {
+ $comments = $wpdb->get_results( $wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d AND comment_agent NOT LIKE 'Disqus/%%'", $post->ID) );
+ }
+
+ // start catching output
+ ob_start();
+
+ echo '\n";
+?>
+
+
+
+
+
+
+
+ WordPress ; Disqus
+in_the_loop = true; // Fake being in the loop.
+setup_postdata($post); ?>
+
+post_title); ?>
+
+
+
+
+post_content) ); ?>
+
+ID; ?>
+post_date_gmt; ?>
+comment_status; ?>
+
+
+comment_ID; ?>
+comment_author); ?>
+comment_author_email; ?>
+comment_author_url; ?>
+comment_author_IP; ?>
+comment_date; ?>
+comment_date_gmt; ?>
+comment_content) ?>
+comment_approved; ?>
+comment_type; ?>
+comment_parent; ?>
+
+
+
+
+
+
diff --git a/wp-content/plugins/disqus-comment-system/lib/api/LICENSE b/wp-content/plugins/disqus-comment-system/lib/api/LICENSE
deleted file mode 100644
index 880b1df..0000000
--- a/wp-content/plugins/disqus-comment-system/lib/api/LICENSE
+++ /dev/null
@@ -1,202 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
-TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
-2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
-3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
-4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
-5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
-6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
-7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
-8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
-9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
-END OF TERMS AND CONDITIONS
-
-APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
-Copyright 2010 DISQUS
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
\ No newline at end of file
diff --git a/wp-content/plugins/disqus-comment-system/lib/api/README.rst b/wp-content/plugins/disqus-comment-system/lib/api/README.rst
deleted file mode 100644
index 9e86ab4..0000000
--- a/wp-content/plugins/disqus-comment-system/lib/api/README.rst
+++ /dev/null
@@ -1,18 +0,0 @@
-Disqus API 1.1
-
-Please see http://groups.google.com/group/disqus-dev/web/api-1-1 for more information.
-
-Sample usage::
-
- require('disqus/disqus.php');
-
- $dsq = new DisqusAPI($user_api_key, $forum_api_key);
- if (($username = $dsq->get_user_name()) === false)
- {
- throw new Exception($dsq->get_last_error());
- }
-
-
-To run the included unit tests you will need to install PHPUnit::
-
- php disqus/tests.php
diff --git a/wp-content/plugins/disqus-comment-system/lib/api/disqus/disqus.php b/wp-content/plugins/disqus-comment-system/lib/api/disqus/disqus.php
index 2d0fba1..f77fffb 100644
--- a/wp-content/plugins/disqus-comment-system/lib/api/disqus/disqus.php
+++ b/wp-content/plugins/disqus-comment-system/lib/api/disqus/disqus.php
@@ -1,461 +1,461 @@
-
- * @copyright 2007-2010 Big Head Labs
- * @link http://disqus.com/
- * @package Disqus
- * @version 1.1
- */
-
-require_once(dirname(__FILE__) . '/url.php');
-
-/** @#+
- * Constants
- */
-/**
- * Base URL for Disqus.
- */
-
-define('DISQUS_TYPE_SPAM', 'spam');
-define('DISQUS_TYPE_DELETED', 'killed');
-define('DISQUS_TYPE_KILLED', DISQUS_TYPE_DELETED);
-define('DISQUS_TYPE_NEW', 'new');
-
-define('DISQUS_STATE_APPROVED', 'approved');
-define('DISQUS_STATE_UNAPPROVED', 'unapproved');
-define('DISQUS_STATE_SPAM', 'spam');
-define('DISQUS_STATE_DELETED', 'killed');
-define('DISQUS_STATE_KILLED', DISQUS_STATE_DELETED);
-
-define('DISQUS_ACTION_SPAM', 'spam');
-define('DISQUS_ACTION_APPROVE', 'approve');
-define('DISQUS_ACTION_DELETE', 'delete');
-define('DISQUS_ACTION_KILL', 'kill');
-
-if (!extension_loaded('json')) {
- require_once(dirname(__FILE__) . '/json.php');
- function dsq_json_decode($data) {
- $json = new JSON;
- return $json->unserialize($data);
- }
-} else {
- function dsq_json_decode($data) {
- return json_decode($data);
- }
-}
-
-/**
- * Helper methods for all of the Disqus 1.1 API methods.
- *
- * @package Disqus
- * @author DISQUS.com
- * @copyright 2007-2010 Big Head Labs
- * @version 1.1
- */
-class DisqusAPI {
- var $user_api_key;
- var $forum_api_key;
- var $api_url = 'https://www.disqus.com/api/';
- var $api_version = '1.1';
-
- /**
- * Creates a new interface to the Disqus API.
- *
- * @param $user_api_key
- * (optional) The User API key to use.
- * @param $forum_api_key
- * (optional) The Forum API key to use.
- * @param $api_url
- * (optional) The prefix URL to use when calling the Disqus API.
- */
- function DisqusAPI($user_api_key, $forum_api_key, $api_url='https://www.disqus.com/api/') {
- $this->user_api_key = $user_api_key;
- $this->forum_api_key = $forum_api_key;
- $this->api_url = $api_url;
- $this->last_error = null;
- }
-
- /**
- * Makes a call to a Disqus API method.
- *
- * @return
- * The Disqus object.
- * @param $method
- * The Disqus API method to call.
- * @param $args
- * An associative array of arguments to be passed.
- * @param $post
- * TRUE or FALSE, depending on whether we're making a POST call.
- */
- function call($method, $args=array(), $post=false) {
- $url = $this->api_url . $method . '/';
-
- if (!isset($args['user_api_key'])) {
- $args['user_api_key'] = $this->user_api_key;
- }
- if (!isset($args['forum_api_key'])) {
- $args['forum_api_key'] = $this->forum_api_key;
- }
- if (!isset($args['api_version'])) {
- $args['api_version'] = $this->api_version;
- }
-
- foreach ($args as $key=>$value) {
- // XXX: Disqus is lacking some exception handling and we sometimes
- // end up with 500s when passing invalid values
- if (empty($value)) unset($args[$key]);
- }
-
- if (!$post) {
- $url .= '?' . dsq_get_query_string($args);
- $args = null;
- }
-
- if (!($response = dsq_urlopen($url, $args)) || !$response['code']) {
- $this->last_error = 'Unable to connect to the Disqus API servers';
- return false;
- }
-
- if ($response['code'] != 200) {
- if ($response['code'] == 500) {
- // Try to grab the exception ID for better reporting
- if (!empty($response['headers']['X-Sentry-ID'])) {
- $this->last_error = 'DISQUS returned a bad response (HTTP '.$response['code'].', ReferenceID: '.$response['headers']['X-Sentry-ID'].')';
- return false;
- }
- } elseif ($response['code'] == 400) {
- $data = dsq_json_decode($response['data']);
- if ($data && $data->message) {
- $this->last_error = $data->message;
- } else {
- $this->last_error = "DISQUS returned a bad response (HTTP ".$response['code'].")";
- }
- return false;
- }
- $this->last_error = "DISQUS returned a bad response (HTTP ".$response['code'].")";
- return false;
- }
-
- $data = dsq_json_decode($response['data']);
-
- if (!$data) {
- $this->last_error = 'No valid JSON content returned from Disqus';
- return false;
- }
-
- if (!$data->succeeded) {
- if (!$data->message) {
- $this->last_error = '(No error message was received)';
- } else {
- $this->last_error = $data->message;
- }
- return false;
- }
-
- $this->last_error = null;
-
- return $data->message;
- }
-
- /**
- * Retrieve the last error message recorded.
- *
- * @return
- * The last recorded error from the API
- */
- function get_last_error() {
- if (empty($this->last_error)) return;
- if (!is_string($this->last_error)) {
- return var_export($this->last_error);
- }
- return $this->last_error;
- }
-
- /**
- * Validate API key and get username.
- *
- * @return
- * Username matching the API key
- */
- function get_user_name() {
- return $this->call('get_user_name', array(), true);
- }
-
- /**
- * Returns an array of hashes representing all forums the user owns.
- *
- * @return
- * An array of hashes representing all forums the user owns.
- */
- function get_forum_list() {
- return $this->call('get_forum_list');
- }
-
- /**
- * Get a forum API key for a specific forum.
- *
- * @param $forum_id
- * the unique id of the forum
- * @return
- * A string which is the Forum Key for the given forum.
- */
- function get_forum_api_key($forum_id) {
- $params = array(
- 'forum_id' => $forum_id,
- );
-
- return $this->call('get_forum_api_key', $params);
- }
-
- /**
- * Get a list of comments on a website.
- *
- * Both filter and exclude are multivalue arguments with comma as a divider.
- * That makes is possible to use combined requests. For example, if you want
- * to get all deleted spam messages, your filter argument should contain
- * 'spam,killed' string.
- *
- * @param $forum_id
- * The forum ID.
- * @param $params
- * - limit: Number of entries that should be included in the response. Default is 25.
- * - start: Starting point for the query. Default is 0.
- * - filter: Type of entries that should be returned.
- * - exclude: Type of entries that should be excluded from the response.
- * @return
- * Returns posts from a forum specified by id.
- */
- function get_forum_posts($forum_id, $params=array()) {
- $params['forum_id'] = $forum_id;
-
- return $this->call('get_forum_posts', $params);
- }
-
- /**
- * Count a number of comments in articles.
- *
- * @param $thread_ids
- * an array of thread IDs belonging to the given forum.
- * @return
- * A hash having thread_ids as keys and 2-element arrays as values.
- */
- function get_num_posts($thread_ids) {
- $params = array(
- 'thread_ids' => is_array($thread_ids) ? implode(',', $thread_ids) : $thread_ids,
- );
-
- return $this->call('get_num_posts', $params);
- }
-
- /**
- * Returns a list of categories that were created for a website (forum) provided.
- *
- * @param $forum_id
- * the unique of the forum
- * @return
- * A hash containing category_id, title, forum_id, and is_default.
- */
- function get_categories_list($forum_id) {
- $params = array(
- 'forum_id' => $forum_id,
- );
-
- return $this->call('get_categories_list', $params);
- }
-
- /**
- * Get a list of threads on a website.
- *
- * @param $forum_id
- * the unique id of the forum.
- * @param $params
- * - limit: Number of entries that should be included in the response. Default is 25.
- * - start: Starting point for the query. Default is 0.
- * - category_id: Filter entries by category
- * @return
- * An array of hashes representing all threads belonging to the given forum.
- */
- function get_thread_list($forum_id, $params=array()) {
- $params['forum_id'] = $forum_id;
-
- return $this->call('get_thread_list', $params);
- }
-
- /**
- * Get a list of threads with new comments.
- *
- * @param $forum_id
- * The Forum ID.
- * @param $since
- * Start date for new posts. Format: 2009-03-30T15:41, Timezone: UTC.
- * @return
- * An array of hashes representing all threads with new comments since offset.
- */
- function get_updated_threads($forum_id, $since) {
- $params = array(
- 'forum_id' => $forum_id,
- 'since' => is_string($since) ? $string : strftime('%Y-%m-%dT%H:%M', $since),
- );
-
- return $this->call('get_updated_threads', $params);
- }
-
- /**
- * Get a list of comments in a thread.
- *
- * Both filter and exclude are multivalue arguments with comma as a divider.
- * That makes is possible to use combined requests. For example, if you want
- * to get all deleted spam messages, your filter argument should contain
- * 'spam,killed' string. Note that values are joined by AND statement so
- * 'spam,new' will return all messages that are new and marked as spam. It
- * will not return messages that are new and not spam or that are spam but
- * not new (i.e. has already been moderated).
- *
- * @param $thread_id
- * The ID of a thread belonging to the given forum
- * @param $params
- * - limit: Number of entries that should be included in the response. Default is 25.
- * - start: Starting point for the query. Default is 0.
- * - filter: Type of entries that should be returned (new, spam or killed).
- * - exclude: Type of entries that should be excluded from the response (new, spam or killed).
- * @return
- * An array of hashes representing representing all posts belonging to the
- * given forum.
- */
- function get_thread_posts($thread_id, $params=array()) {
- $params['thread_id'] = $thread_id;
-
- return $this->call('get_thread_posts', $params);
- }
-
- /**
- * Get or create thread by identifier.
- *
- * This method tries to find a thread by its identifier and title. If there is
- * no such thread, the method creates it. In either case, the output value is
- * a thread object.
- *
- * @param $identifier
- * Unique value (per forum) for a thread that is used to keep be able to get
- * data even if permalink is changed.
- * @param $title
- * The title of the thread to possibly be created.
- * @param $params
- * - category_id: Filter entries by category
- * - create_on_fail: if thread does not exist, the method will create it
- * @return
- * Returns a hash with two keys:
- * - thread: a hash representing the thread corresponding to the identifier.
- * - created: indicates whether the thread was created as a result of this
- * method call. If created, it will have the specified title.
- */
- function thread_by_identifier($identifier, $title, $params=array()) {
- $params['identifier'] = $identifier;
- $params['title'] = $title;
-
- return $this->call('thread_by_identifier', $params, true);
- }
-
- /**
- * Get thread by URL.
- *
- * Finds a thread by its URL. Output value is a thread object.
- *
- * @param $url
- * the URL to check for an associated thread
- * @param $partner_api_key
- * (optional) The Partner API key.
- * @return
- * A thread object, otherwise NULL.
- */
- function get_thread_by_url($url, $partner_api_key=null) {
- $params = array(
- 'url' => $url,
- 'partner_api_key' => $partner_api_key,
- );
-
- return $this->call('get_thread_by_url', $params);
- }
-
- /**
- * Updates thread.
- *
- * Updates thread, specified by id and forum API key, with values described in
- * the optional arguments.
- *
- * @param $thread_id
- * the ID of a thread belonging to the given forum
- * @param $params
- * - title: the title of the thread
- * - slug: the per-forum-unique string used for identifying this thread in
- * disqus.com URL’s relating to this thread. Composed of
- * underscore-separated alphanumeric strings.
- * - url: the URL this thread is on, if known.
- * - allow_comments: whether this thread is open to new comments
- * @return
- * Returns an empty success message.
- */
- function update_thread($thread_id, $params=array()) {
- $params['thread_id'] = $thread_id;
-
- return $this->call('update_thread', $params, true);
- }
-
- /**
- * Creates a new post.
- *
- * Creates a comment to the thread specified by id.
- *
- * @param $thread_id
- * the thread to post to
- * @param $message
- * the content of the post
- * @param $author_name
- * the post creator’s name
- * @param $author_email
- * the post creator’s email address
- * @param $params
- * - partner_api_key
- * - created_at: Format: 2009-03-30T15:41, Timezone: UTC
- * - ip_address: the author’s IP address
- * - author_url: the author's homepage
- * - parent_post: the id of the parent post
- * - state: Comment's state, must be one of the following: approved,
- * unapproved, spam, killed
- * @return
- * Returns modified version.
- */
- function create_post($thread_id, $message, $author_name, $author_email, $params=array()) {
- $params['thread_id'] = $thread_id;
- $params['message'] = $message;
- $params['author_name'] = $author_name;
- $params['author_email'] = $author_email;
-
- return $this->call('create_post', $params, true);
- }
-
- /**
- * Delete a comment or mark it as spam (or not spam).
- *
- * @param $post_id
- * The Post ID.
- * @param $action
- * Name of action to be performed. Value can be 'spam', 'approve' or 'kill'.
- * @return
- * Returns modified version.
- */
- function moderate_post($post_id, $action) {
- $params = array(
- 'post_id' => $post_id,
- 'action' => $action,
- );
-
- return $this->call('moderate_post', $params, true);
- }
-}
-
-?>
+
+ * @copyright 2007-2010 Big Head Labs
+ * @link http://disqus.com/
+ * @package Disqus
+ * @version 1.1
+ */
+
+require_once(dirname(__FILE__) . '/url.php');
+
+/** @#+
+ * Constants
+ */
+/**
+ * Base URL for Disqus.
+ */
+
+define('DISQUS_TYPE_SPAM', 'spam');
+define('DISQUS_TYPE_DELETED', 'killed');
+define('DISQUS_TYPE_KILLED', DISQUS_TYPE_DELETED);
+define('DISQUS_TYPE_NEW', 'new');
+
+define('DISQUS_STATE_APPROVED', 'approved');
+define('DISQUS_STATE_UNAPPROVED', 'unapproved');
+define('DISQUS_STATE_SPAM', 'spam');
+define('DISQUS_STATE_DELETED', 'killed');
+define('DISQUS_STATE_KILLED', DISQUS_STATE_DELETED);
+
+define('DISQUS_ACTION_SPAM', 'spam');
+define('DISQUS_ACTION_APPROVE', 'approve');
+define('DISQUS_ACTION_DELETE', 'delete');
+define('DISQUS_ACTION_KILL', 'kill');
+
+if (!extension_loaded('json')) {
+ require_once(dirname(__FILE__) . '/json.php');
+ function dsq_json_decode($data) {
+ $json = new JSON;
+ return $json->unserialize($data);
+ }
+} else {
+ function dsq_json_decode($data) {
+ return json_decode($data);
+ }
+}
+
+/**
+ * Helper methods for all of the Disqus 1.1 API methods.
+ *
+ * @package Disqus
+ * @author DISQUS.com
+ * @copyright 2007-2010 Big Head Labs
+ * @version 1.1
+ */
+class DisqusAPI {
+ var $user_api_key;
+ var $forum_api_key;
+ var $api_url = 'https://www.disqus.com/api/';
+ var $api_version = '1.1';
+
+ /**
+ * Creates a new interface to the Disqus API.
+ *
+ * @param $user_api_key
+ * (optional) The User API key to use.
+ * @param $forum_api_key
+ * (optional) The Forum API key to use.
+ * @param $api_url
+ * (optional) The prefix URL to use when calling the Disqus API.
+ */
+ function DisqusAPI($user_api_key, $forum_api_key, $api_url='https://www.disqus.com/api/') {
+ $this->user_api_key = $user_api_key;
+ $this->forum_api_key = $forum_api_key;
+ $this->api_url = $api_url;
+ $this->last_error = null;
+ }
+
+ /**
+ * Makes a call to a Disqus API method.
+ *
+ * @return
+ * The Disqus object.
+ * @param $method
+ * The Disqus API method to call.
+ * @param $args
+ * An associative array of arguments to be passed.
+ * @param $post
+ * TRUE or FALSE, depending on whether we're making a POST call.
+ */
+ function call($method, $args=array(), $post=false) {
+ $url = $this->api_url . $method . '/';
+
+ if (!isset($args['user_api_key'])) {
+ $args['user_api_key'] = $this->user_api_key;
+ }
+ if (!isset($args['forum_api_key'])) {
+ $args['forum_api_key'] = $this->forum_api_key;
+ }
+ if (!isset($args['api_version'])) {
+ $args['api_version'] = $this->api_version;
+ }
+
+ foreach ($args as $key=>$value) {
+ // XXX: Disqus is lacking some exception handling and we sometimes
+ // end up with 500s when passing invalid values
+ if (empty($value)) unset($args[$key]);
+ }
+
+ if (!$post) {
+ $url .= '?' . dsq_get_query_string($args);
+ $args = null;
+ }
+
+ if (!($response = dsq_urlopen($url, $args)) || !$response['code']) {
+ $this->last_error = 'Unable to connect to the Disqus API servers';
+ return false;
+ }
+
+ if ($response['code'] != 200) {
+ if ($response['code'] == 500) {
+ // Try to grab the exception ID for better reporting
+ if (!empty($response['headers']['X-Sentry-ID'])) {
+ $this->last_error = 'DISQUS returned a bad response (HTTP '.$response['code'].', ReferenceID: '.$response['headers']['X-Sentry-ID'].')';
+ return false;
+ }
+ } elseif ($response['code'] == 400) {
+ $data = dsq_json_decode($response['data']);
+ if ($data && $data->message) {
+ $this->last_error = $data->message;
+ } else {
+ $this->last_error = "DISQUS returned a bad response (HTTP ".$response['code'].")";
+ }
+ return false;
+ }
+ $this->last_error = "DISQUS returned a bad response (HTTP ".$response['code'].")";
+ return false;
+ }
+
+ $data = dsq_json_decode($response['data']);
+
+ if (!$data) {
+ $this->last_error = 'No valid JSON content returned from Disqus';
+ return false;
+ }
+
+ if (!$data->succeeded) {
+ if (!$data->message) {
+ $this->last_error = '(No error message was received)';
+ } else {
+ $this->last_error = $data->message;
+ }
+ return false;
+ }
+
+ $this->last_error = null;
+
+ return $data->message;
+ }
+
+ /**
+ * Retrieve the last error message recorded.
+ *
+ * @return
+ * The last recorded error from the API
+ */
+ function get_last_error() {
+ if (empty($this->last_error)) return;
+ if (!is_string($this->last_error)) {
+ return var_export($this->last_error);
+ }
+ return $this->last_error;
+ }
+
+ /**
+ * Validate API key and get username.
+ *
+ * @return
+ * Username matching the API key
+ */
+ function get_user_name() {
+ return $this->call('get_user_name', array(), true);
+ }
+
+ /**
+ * Returns an array of hashes representing all forums the user owns.
+ *
+ * @return
+ * An array of hashes representing all forums the user owns.
+ */
+ function get_forum_list() {
+ return $this->call('get_forum_list');
+ }
+
+ /**
+ * Get a forum API key for a specific forum.
+ *
+ * @param $forum_id
+ * the unique id of the forum
+ * @return
+ * A string which is the Forum Key for the given forum.
+ */
+ function get_forum_api_key($forum_id) {
+ $params = array(
+ 'forum_id' => $forum_id,
+ );
+
+ return $this->call('get_forum_api_key', $params);
+ }
+
+ /**
+ * Get a list of comments on a website.
+ *
+ * Both filter and exclude are multivalue arguments with comma as a divider.
+ * That makes is possible to use combined requests. For example, if you want
+ * to get all deleted spam messages, your filter argument should contain
+ * 'spam,killed' string.
+ *
+ * @param $forum_id
+ * The forum ID.
+ * @param $params
+ * - limit: Number of entries that should be included in the response. Default is 25.
+ * - start: Starting point for the query. Default is 0.
+ * - filter: Type of entries that should be returned.
+ * - exclude: Type of entries that should be excluded from the response.
+ * @return
+ * Returns posts from a forum specified by id.
+ */
+ function get_forum_posts($forum_id, $params=array()) {
+ $params['forum_id'] = $forum_id;
+
+ return $this->call('get_forum_posts', $params);
+ }
+
+ /**
+ * Count a number of comments in articles.
+ *
+ * @param $thread_ids
+ * an array of thread IDs belonging to the given forum.
+ * @return
+ * A hash having thread_ids as keys and 2-element arrays as values.
+ */
+ function get_num_posts($thread_ids) {
+ $params = array(
+ 'thread_ids' => is_array($thread_ids) ? implode(',', $thread_ids) : $thread_ids,
+ );
+
+ return $this->call('get_num_posts', $params);
+ }
+
+ /**
+ * Returns a list of categories that were created for a website (forum) provided.
+ *
+ * @param $forum_id
+ * the unique of the forum
+ * @return
+ * A hash containing category_id, title, forum_id, and is_default.
+ */
+ function get_categories_list($forum_id) {
+ $params = array(
+ 'forum_id' => $forum_id,
+ );
+
+ return $this->call('get_categories_list', $params);
+ }
+
+ /**
+ * Get a list of threads on a website.
+ *
+ * @param $forum_id
+ * the unique id of the forum.
+ * @param $params
+ * - limit: Number of entries that should be included in the response. Default is 25.
+ * - start: Starting point for the query. Default is 0.
+ * - category_id: Filter entries by category
+ * @return
+ * An array of hashes representing all threads belonging to the given forum.
+ */
+ function get_thread_list($forum_id, $params=array()) {
+ $params['forum_id'] = $forum_id;
+
+ return $this->call('get_thread_list', $params);
+ }
+
+ /**
+ * Get a list of threads with new comments.
+ *
+ * @param $forum_id
+ * The Forum ID.
+ * @param $since
+ * Start date for new posts. Format: 2009-03-30T15:41, Timezone: UTC.
+ * @return
+ * An array of hashes representing all threads with new comments since offset.
+ */
+ function get_updated_threads($forum_id, $since) {
+ $params = array(
+ 'forum_id' => $forum_id,
+ 'since' => is_string($since) ? $string : strftime('%Y-%m-%dT%H:%M', $since),
+ );
+
+ return $this->call('get_updated_threads', $params);
+ }
+
+ /**
+ * Get a list of comments in a thread.
+ *
+ * Both filter and exclude are multivalue arguments with comma as a divider.
+ * That makes is possible to use combined requests. For example, if you want
+ * to get all deleted spam messages, your filter argument should contain
+ * 'spam,killed' string. Note that values are joined by AND statement so
+ * 'spam,new' will return all messages that are new and marked as spam. It
+ * will not return messages that are new and not spam or that are spam but
+ * not new (i.e. has already been moderated).
+ *
+ * @param $thread_id
+ * The ID of a thread belonging to the given forum
+ * @param $params
+ * - limit: Number of entries that should be included in the response. Default is 25.
+ * - start: Starting point for the query. Default is 0.
+ * - filter: Type of entries that should be returned (new, spam or killed).
+ * - exclude: Type of entries that should be excluded from the response (new, spam or killed).
+ * @return
+ * An array of hashes representing representing all posts belonging to the
+ * given forum.
+ */
+ function get_thread_posts($thread_id, $params=array()) {
+ $params['thread_id'] = $thread_id;
+
+ return $this->call('get_thread_posts', $params);
+ }
+
+ /**
+ * Get or create thread by identifier.
+ *
+ * This method tries to find a thread by its identifier and title. If there is
+ * no such thread, the method creates it. In either case, the output value is
+ * a thread object.
+ *
+ * @param $identifier
+ * Unique value (per forum) for a thread that is used to keep be able to get
+ * data even if permalink is changed.
+ * @param $title
+ * The title of the thread to possibly be created.
+ * @param $params
+ * - category_id: Filter entries by category
+ * - create_on_fail: if thread does not exist, the method will create it
+ * @return
+ * Returns a hash with two keys:
+ * - thread: a hash representing the thread corresponding to the identifier.
+ * - created: indicates whether the thread was created as a result of this
+ * method call. If created, it will have the specified title.
+ */
+ function thread_by_identifier($identifier, $title, $params=array()) {
+ $params['identifier'] = $identifier;
+ $params['title'] = $title;
+
+ return $this->call('thread_by_identifier', $params, true);
+ }
+
+ /**
+ * Get thread by URL.
+ *
+ * Finds a thread by its URL. Output value is a thread object.
+ *
+ * @param $url
+ * the URL to check for an associated thread
+ * @param $partner_api_key
+ * (optional) The Partner API key.
+ * @return
+ * A thread object, otherwise NULL.
+ */
+ function get_thread_by_url($url, $partner_api_key=null) {
+ $params = array(
+ 'url' => $url,
+ 'partner_api_key' => $partner_api_key,
+ );
+
+ return $this->call('get_thread_by_url', $params);
+ }
+
+ /**
+ * Updates thread.
+ *
+ * Updates thread, specified by id and forum API key, with values described in
+ * the optional arguments.
+ *
+ * @param $thread_id
+ * the ID of a thread belonging to the given forum
+ * @param $params
+ * - title: the title of the thread
+ * - slug: the per-forum-unique string used for identifying this thread in
+ * disqus.com URL’s relating to this thread. Composed of
+ * underscore-separated alphanumeric strings.
+ * - url: the URL this thread is on, if known.
+ * - allow_comments: whether this thread is open to new comments
+ * @return
+ * Returns an empty success message.
+ */
+ function update_thread($thread_id, $params=array()) {
+ $params['thread_id'] = $thread_id;
+
+ return $this->call('update_thread', $params, true);
+ }
+
+ /**
+ * Creates a new post.
+ *
+ * Creates a comment to the thread specified by id.
+ *
+ * @param $thread_id
+ * the thread to post to
+ * @param $message
+ * the content of the post
+ * @param $author_name
+ * the post creator’s name
+ * @param $author_email
+ * the post creator’s email address
+ * @param $params
+ * - partner_api_key
+ * - created_at: Format: 2009-03-30T15:41, Timezone: UTC
+ * - ip_address: the author’s IP address
+ * - author_url: the author's homepage
+ * - parent_post: the id of the parent post
+ * - state: Comment's state, must be one of the following: approved,
+ * unapproved, spam, killed
+ * @return
+ * Returns modified version.
+ */
+ function create_post($thread_id, $message, $author_name, $author_email, $params=array()) {
+ $params['thread_id'] = $thread_id;
+ $params['message'] = $message;
+ $params['author_name'] = $author_name;
+ $params['author_email'] = $author_email;
+
+ return $this->call('create_post', $params, true);
+ }
+
+ /**
+ * Delete a comment or mark it as spam (or not spam).
+ *
+ * @param $post_id
+ * The Post ID.
+ * @param $action
+ * Name of action to be performed. Value can be 'spam', 'approve' or 'kill'.
+ * @return
+ * Returns modified version.
+ */
+ function moderate_post($post_id, $action) {
+ $params = array(
+ 'post_id' => $post_id,
+ 'action' => $action,
+ );
+
+ return $this->call('moderate_post', $params, true);
+ }
+}
+
+?>
diff --git a/wp-content/plugins/disqus-comment-system/lib/api/disqus/json.php b/wp-content/plugins/disqus-comment-system/lib/api/disqus/json.php
index 54570f3..c939ebf 100644
--- a/wp-content/plugins/disqus-comment-system/lib/api/disqus/json.php
+++ b/wp-content/plugins/disqus-comment-system/lib/api/disqus/json.php
@@ -1,378 +1,378 @@
-
- * @copyright 2007 Cesar D. Rodas
- * @license http://www.opensource.org/licenses/bsd-license.php BSD License
- * @version 1.0
- * @link http://cesars.users.phpclasses.org/json
- */
-
-define('IN_NOWHERE',0);
-define('IN_STRING',1);
-define('IN_OBJECT',2);
-define('IN_ATOMIC',3);
-define('IN_ASSIGN',4);
-define('IN_ENDSTMT',5);
-define('IN_ARRAY',6);
-
-/**
- * JSON
- *
- * This class serilize an PHP OBJECT or an ARRAY into JSON
- * notation. Also convert a JSON text into a PHP OBJECT or
- * array.
- *
- * @category Javascript
- * @package JSON
- * @author Cesar D. Rodas
- * @copyright 2007 Cesar D. Rodas
- * @license http://www.opensource.org/licenses/bsd-license.php BSD License
- * @version 1.0
- * @link http://cesars.users.phpclasses.org/json
- */
-class JSON
-{
- /**
- * Was parsed with an error?
- *
- * var bool
- * @access private
- */
- var $error;
-
- function Json() {
- $this->error = false;
- }
-
- /**
- * Serialize
- *
- * Serialize a PHP OBJECT or an ARRAY into
- * JSON notation.
- *
- * param mixed $obj Object or array to serialize
- * return string JSON.
- */
- function serialize($obj) {
- if ( is_object($obj) ) {
- $e = get_object_vars($obj);
- /* bug reported by Ben Rowe */
- /* Adding default empty array if the */
- /* object doesn't have any property */
- $properties = array();
- foreach ($e as $k => $v) {
- $properties[] = $this->_serialize( $k,$v );
- }
- return "{".implode(",",$properties)."}";
- } else if ( is_array($obj) ) {
- return $this->_serialize('',$obj);
- }
- }
-
- /**
- * UnSerialize
- *
- * Transform an JSON text into a PHP object
- * and return it.
- * @access public
- * @param string $text JSON text
- * @return mixed PHP Object, array or false.
- */
- function unserialize( $text ) {
- $this->error = false;
-
- return !$this->error ? $this->_unserialize($text) : false;
- }
-
- /**
- * UnSerialize
- *
- * Transform an JSON text into a PHP object
- * and return it.
- * @access private
- * @param string $text JSON text
- * @return mixed PHP Object, array or false.
- */
- function _unserialize($text) {
- $ret = new stdClass;
-
- while ( $f = $this->getNextToken($text,$i,$type) ) {
- switch ( $type ) {
- case IN_ARRAY:
- $tmp = $this->_unserializeArray($text);
- $ret = $tmp[0];
- break;
- case IN_OBJECT:
- $g=0;
- do {
- $varName = $this->getNextToken($f,$g,$xType);
- if ( $xType != IN_STRING ) {
- return false; /* error parsing */
- }
- $this->getNextToken($f,$g,$xType);
- if ( $xType != IN_ASSIGN) return false;
- $value = $this->getNextToken($f,$g,$xType);
-
- if ( $xType == IN_OBJECT) {
- $ret->$varName = $this->unserialize( "{".$value."}" );
- $g--;
- } else if ($xType == IN_ARRAY) {
- $ret->$varName = $this->_unserializeArray( $value);
- $g--;
- } else
- $ret->$varName = $value;
-
- $this->getNextToken($f,$g,$xType);
- } while ( $xType == IN_ENDSTMT);
- break;
- default:
- $this->error = true;
- break 2;
- }
- }
- return $ret;
- }
-
- /**
- * JSON Array Parser
- *
- * This method transform an json-array into a PHP
- * array
- * @access private
- * @param string $text String to parse
- * @return Array PHP Array
- */
- function _unserializeArray($text) {
- $r = array();
- do {
- $f = $this->getNextToken($text,$i,$type);
- switch ( $type ) {
- case IN_STRING:
- case IN_ATOMIC:
- $r[] = $f;
- break;
- case IN_OBJECT:
- $r[] = $this->unserialize("{".$f."}");
- $i--;
- break;
- case IN_ARRAY:
- $r[] = $this->_unserializeArray($f);
- $i--;
- break;
-
- }
- $this->getNextToken($text,$i,$type);
- } while ( $type == IN_ENDSTMT);
-
- return $r;
- }
-
- /**
- * Tokenizer
- *
- * Return to the Parser the next valid token and the type
- * of the token. If the tokenizer fails it returns false.
- *
- * @access private
- * @param string $e Text to extract token
- * @param integer $i Start position to search next token
- * @param integer $state Variable to get the token type
- * @return string|bool Token in string or false on error.
- */
- function getNextToken($e, &$i, &$state) {
- $state = IN_NOWHERE;
- $end = -1;
- $start = -1;
- while ( $i < strlen($e) && $end == -1 ) {
- switch( $e[$i] ) {
- /* objects */
- case "{":
- case "[":
- $_tag = $e[$i];
- $_endtag = $_tag == "{" ? "}" : "]";
- if ( $state == IN_NOWHERE ) {
- $start = $i+1;
- switch ($state) {
- case IN_NOWHERE:
- $aux = 1; /* for loop objects */
- $state = $_tag == "{" ? IN_OBJECT : IN_ARRAY;
- break;
- default:
- break 2; /* exit from switch and while */
- }
- while ( ++$i && $i < strlen($e) && $aux != 0 ) {
- switch( $e[$i] ) {
- case $_tag:
- $aux++;
- break;
- case $_endtag:
- $aux--;
- break;
- }
- }
- $end = $i-1;
- }
- break;
-
- case '"':
- case "'":
- $state = IN_STRING;
- $buf = "";
- while ( ++$i && $i < strlen($e) && $e[$i] != '"' ) {
- if ( $e[$i] == "\\")
- $i++;
- $buf .= $e[$i];
- }
- $i++;
- return $buf;
- break;
- case ":":
- $state = IN_ASSIGN;
- $end = 1;
- break;
- case "n":
- if ( substr($e,$i,4) == "null" ) {
- $i=$i+4;
- $state = IN_ATOMIC;
- return NULL;
- }
- else break 2; /* exit from switch and while */
- case "t":
- if ( substr($e,$i,4) == "true") {
- $state = IN_ATOMIC;
- $i=$i+4;
- return true;
- }
- else break 2; /* exit from switch and while */
- break;
- case "f":
- if ( substr($e,$i,5) == "false") {
- $state = IN_ATOMIC;
- $i=$i+5;
- return false;
- }
- else break 2; /* exit from switch and while */
- break;
- case ",":
- $state = IN_ENDSTMT;
- $end = 1;
- break;
- case " ":
- case "\t":
- case "\r":
- case "\n":
- break;
- case "+":
- case "-":
- case 0:
- case 1:
- case 2:
- case 3:
- case 4:
- case 5:
- case 6:
- case 7:
- case 8:
- case 9:
- case '.':
- $state = IN_ATOMIC;
- $start = (int)$i;
- if ( $e[$i] == "-" || $e[$i] == "+")
- $i++;
- for ( ; $i < strlen($e) && (is_numeric($e[$i]) || $e[$i] == "." || strtolower($e[$i]) == "e") ;$i++){
- $n = $i+1 < strlen($e) ? $e[$i+1] : "";
- $a = strtolower($e[$i]);
- if ( $a == "e" && ($n == "+" || $n == "-"))
- $i++;
- else if ( $a == "e")
- $this->error=true;
- }
-
- $end = $i;
- break 2; /* break while too */
- default:
- $this->error = true;
-
- }
- $i++;
- }
-
- return $start == -1 || $end == -1 ? false : substr($e, $start, $end - $start);
- }
-
- /**
- * Internal Serializer
- *
- * @param string $key Variable name
- * @param mixed $value Value of the variable
- * @access private
- * @return string Serialized variable
- */
- function _serialize ( $key = '', &$value ) {
- $r = '';
- if ( $key != '')$r .= "\"${key}\" : ";
- if ( is_numeric($value) ) {
- $r .= ''.$value.'';
- } else if ( is_string($value) ) {
- $r .= '"'.$this->toString($value).'"';
- } else if ( is_object($value) ) {
- $r .= $this->serialize($value);
- } else if ( is_null($value) ) {
- $r .= "null";
- } else if ( is_bool($value) ) {
- $r .= $value ? "true":"false";
- } else if ( is_array($value) ) {
- foreach($value as $k => $v)
- $f[] = $this->_serialize('',$v);
- $r .= "[".implode(",",$f)."]";
- unset($f);
- }
- return $r;
- }
-
- /**
- * Convert String variables
- *
- * @param string $e Variable with an string value
- * @access private
- * @return string Serialized variable
- */
- function toString($e) {
- $rep = array("\\","\r","\n","\t","'",'"');
- $val = array("\\\\",'\r','\n','\t','\'','\"');
- $e = str_replace($rep, $val, $e);
- return $e;
- }
-}
+
+ * @copyright 2007 Cesar D. Rodas
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version 1.0
+ * @link http://cesars.users.phpclasses.org/json
+ */
+
+define('IN_NOWHERE',0);
+define('IN_STRING',1);
+define('IN_OBJECT',2);
+define('IN_ATOMIC',3);
+define('IN_ASSIGN',4);
+define('IN_ENDSTMT',5);
+define('IN_ARRAY',6);
+
+/**
+ * JSON
+ *
+ * This class serilize an PHP OBJECT or an ARRAY into JSON
+ * notation. Also convert a JSON text into a PHP OBJECT or
+ * array.
+ *
+ * @category Javascript
+ * @package JSON
+ * @author Cesar D. Rodas
+ * @copyright 2007 Cesar D. Rodas
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version 1.0
+ * @link http://cesars.users.phpclasses.org/json
+ */
+class JSON
+{
+ /**
+ * Was parsed with an error?
+ *
+ * var bool
+ * @access private
+ */
+ var $error;
+
+ function Json() {
+ $this->error = false;
+ }
+
+ /**
+ * Serialize
+ *
+ * Serialize a PHP OBJECT or an ARRAY into
+ * JSON notation.
+ *
+ * param mixed $obj Object or array to serialize
+ * return string JSON.
+ */
+ function serialize($obj) {
+ if ( is_object($obj) ) {
+ $e = get_object_vars($obj);
+ /* bug reported by Ben Rowe */
+ /* Adding default empty array if the */
+ /* object doesn't have any property */
+ $properties = array();
+ foreach ($e as $k => $v) {
+ $properties[] = $this->_serialize( $k,$v );
+ }
+ return "{".implode(",",$properties)."}";
+ } else if ( is_array($obj) ) {
+ return $this->_serialize('',$obj);
+ }
+ }
+
+ /**
+ * UnSerialize
+ *
+ * Transform an JSON text into a PHP object
+ * and return it.
+ * @access public
+ * @param string $text JSON text
+ * @return mixed PHP Object, array or false.
+ */
+ function unserialize( $text ) {
+ $this->error = false;
+
+ return !$this->error ? $this->_unserialize($text) : false;
+ }
+
+ /**
+ * UnSerialize
+ *
+ * Transform an JSON text into a PHP object
+ * and return it.
+ * @access private
+ * @param string $text JSON text
+ * @return mixed PHP Object, array or false.
+ */
+ function _unserialize($text) {
+ $ret = new stdClass;
+
+ while ( $f = $this->getNextToken($text,$i,$type) ) {
+ switch ( $type ) {
+ case IN_ARRAY:
+ $tmp = $this->_unserializeArray($text);
+ $ret = $tmp[0];
+ break;
+ case IN_OBJECT:
+ $g=0;
+ do {
+ $varName = $this->getNextToken($f,$g,$xType);
+ if ( $xType != IN_STRING ) {
+ return false; /* error parsing */
+ }
+ $this->getNextToken($f,$g,$xType);
+ if ( $xType != IN_ASSIGN) return false;
+ $value = $this->getNextToken($f,$g,$xType);
+
+ if ( $xType == IN_OBJECT) {
+ $ret->$varName = $this->unserialize( "{".$value."}" );
+ $g--;
+ } else if ($xType == IN_ARRAY) {
+ $ret->$varName = $this->_unserializeArray( $value);
+ $g--;
+ } else
+ $ret->$varName = $value;
+
+ $this->getNextToken($f,$g,$xType);
+ } while ( $xType == IN_ENDSTMT);
+ break;
+ default:
+ $this->error = true;
+ break 2;
+ }
+ }
+ return $ret;
+ }
+
+ /**
+ * JSON Array Parser
+ *
+ * This method transform an json-array into a PHP
+ * array
+ * @access private
+ * @param string $text String to parse
+ * @return Array PHP Array
+ */
+ function _unserializeArray($text) {
+ $r = array();
+ do {
+ $f = $this->getNextToken($text,$i,$type);
+ switch ( $type ) {
+ case IN_STRING:
+ case IN_ATOMIC:
+ $r[] = $f;
+ break;
+ case IN_OBJECT:
+ $r[] = $this->unserialize("{".$f."}");
+ $i--;
+ break;
+ case IN_ARRAY:
+ $r[] = $this->_unserializeArray($f);
+ $i--;
+ break;
+
+ }
+ $this->getNextToken($text,$i,$type);
+ } while ( $type == IN_ENDSTMT);
+
+ return $r;
+ }
+
+ /**
+ * Tokenizer
+ *
+ * Return to the Parser the next valid token and the type
+ * of the token. If the tokenizer fails it returns false.
+ *
+ * @access private
+ * @param string $e Text to extract token
+ * @param integer $i Start position to search next token
+ * @param integer $state Variable to get the token type
+ * @return string|bool Token in string or false on error.
+ */
+ function getNextToken($e, &$i, &$state) {
+ $state = IN_NOWHERE;
+ $end = -1;
+ $start = -1;
+ while ( $i < strlen($e) && $end == -1 ) {
+ switch( $e[$i] ) {
+ /* objects */
+ case "{":
+ case "[":
+ $_tag = $e[$i];
+ $_endtag = $_tag == "{" ? "}" : "]";
+ if ( $state == IN_NOWHERE ) {
+ $start = $i+1;
+ switch ($state) {
+ case IN_NOWHERE:
+ $aux = 1; /* for loop objects */
+ $state = $_tag == "{" ? IN_OBJECT : IN_ARRAY;
+ break;
+ default:
+ break 2; /* exit from switch and while */
+ }
+ while ( ++$i && $i < strlen($e) && $aux != 0 ) {
+ switch( $e[$i] ) {
+ case $_tag:
+ $aux++;
+ break;
+ case $_endtag:
+ $aux--;
+ break;
+ }
+ }
+ $end = $i-1;
+ }
+ break;
+
+ case '"':
+ case "'":
+ $state = IN_STRING;
+ $buf = "";
+ while ( ++$i && $i < strlen($e) && $e[$i] != '"' ) {
+ if ( $e[$i] == "\\")
+ $i++;
+ $buf .= $e[$i];
+ }
+ $i++;
+ return $buf;
+ break;
+ case ":":
+ $state = IN_ASSIGN;
+ $end = 1;
+ break;
+ case "n":
+ if ( substr($e,$i,4) == "null" ) {
+ $i=$i+4;
+ $state = IN_ATOMIC;
+ return NULL;
+ }
+ else break 2; /* exit from switch and while */
+ case "t":
+ if ( substr($e,$i,4) == "true") {
+ $state = IN_ATOMIC;
+ $i=$i+4;
+ return true;
+ }
+ else break 2; /* exit from switch and while */
+ break;
+ case "f":
+ if ( substr($e,$i,5) == "false") {
+ $state = IN_ATOMIC;
+ $i=$i+5;
+ return false;
+ }
+ else break 2; /* exit from switch and while */
+ break;
+ case ",":
+ $state = IN_ENDSTMT;
+ $end = 1;
+ break;
+ case " ":
+ case "\t":
+ case "\r":
+ case "\n":
+ break;
+ case "+":
+ case "-":
+ case 0:
+ case 1:
+ case 2:
+ case 3:
+ case 4:
+ case 5:
+ case 6:
+ case 7:
+ case 8:
+ case 9:
+ case '.':
+ $state = IN_ATOMIC;
+ $start = (int)$i;
+ if ( $e[$i] == "-" || $e[$i] == "+")
+ $i++;
+ for ( ; $i < strlen($e) && (is_numeric($e[$i]) || $e[$i] == "." || strtolower($e[$i]) == "e") ;$i++){
+ $n = $i+1 < strlen($e) ? $e[$i+1] : "";
+ $a = strtolower($e[$i]);
+ if ( $a == "e" && ($n == "+" || $n == "-"))
+ $i++;
+ else if ( $a == "e")
+ $this->error=true;
+ }
+
+ $end = $i;
+ break 2; /* break while too */
+ default:
+ $this->error = true;
+
+ }
+ $i++;
+ }
+
+ return $start == -1 || $end == -1 ? false : substr($e, $start, $end - $start);
+ }
+
+ /**
+ * Internal Serializer
+ *
+ * @param string $key Variable name
+ * @param mixed $value Value of the variable
+ * @access private
+ * @return string Serialized variable
+ */
+ function _serialize ( $key = '', &$value ) {
+ $r = '';
+ if ( $key != '')$r .= "\"${key}\" : ";
+ if ( is_numeric($value) ) {
+ $r .= ''.$value.'';
+ } else if ( is_string($value) ) {
+ $r .= '"'.$this->toString($value).'"';
+ } else if ( is_object($value) ) {
+ $r .= $this->serialize($value);
+ } else if ( is_null($value) ) {
+ $r .= "null";
+ } else if ( is_bool($value) ) {
+ $r .= $value ? "true":"false";
+ } else if ( is_array($value) ) {
+ foreach($value as $k => $v)
+ $f[] = $this->_serialize('',$v);
+ $r .= "[".implode(",",$f)."]";
+ unset($f);
+ }
+ return $r;
+ }
+
+ /**
+ * Convert String variables
+ *
+ * @param string $e Variable with an string value
+ * @access private
+ * @return string Serialized variable
+ */
+ function toString($e) {
+ $rep = array("\\","\r","\n","\t","'",'"');
+ $val = array("\\\\",'\r','\n','\t','\'','\"');
+ $e = str_replace($rep, $val, $e);
+ return $e;
+ }
+}
?>
\ No newline at end of file
diff --git a/wp-content/plugins/disqus-comment-system/lib/api/disqus/url.php b/wp-content/plugins/disqus-comment-system/lib/api/disqus/url.php
index 63c2c63..c053921 100644
--- a/wp-content/plugins/disqus-comment-system/lib/api/disqus/url.php
+++ b/wp-content/plugins/disqus-comment-system/lib/api/disqus/url.php
@@ -1,295 +1,295 @@
-$value) {
- $postdata_str .= urlencode($key) . '=' . urlencode($value) . '&';
- }
- }
-
- return $postdata_str;
-}
-
-
-function dsq_get_post_content($boundary, $postdata, $file_name, $file_field) {
- if(empty($file_name) || empty($file_field)) {
- return dsq_get_query_string($postdata);
- }
-
- $content = array();
- $content[] = '--' . $boundary;
- foreach($postdata as $key=>$value) {
- $content[] = 'Content-Disposition: form-data; name="' . $key . '"' . "\r\n\r\n" . $value;
- $content[] = '--' . $boundary;
- }
- $content[] = 'Content-Disposition: form-data; name="' . $file_field . '"; filename="' . $file_name . '"';
- // HACK: We only need to handle text/plain files right now.
- $content[] = "Content-Type: text/plain\r\n";
- $content[] = file_get_contents($file_name);
- $content[] = '--' . $boundary . '--';
- $content = implode("\r\n", $content);
- return $content;
-}
-
-
-function dsq_get_http_headers_for_request($boundary, $content, $file_name, $file_field) {
- $headers = array();
- $headers[] = 'User-Agent: ' . USER_AGENT;
- $headers[] = 'Connection: close';
- if($content) {
- $headers[] = 'Content-Length: ' . strlen($content);
- if($file_name && $file_field) {
- $headers[] = 'Content-Type: multipart/form-data; boundary=' . $boundary;
- } else {
- $headers[] = 'Content-Type: application/x-www-form-urlencoded';
- }
- }
- return implode("\r\n", $headers);
-}
-
-
-function _dsq_curl_urlopen($url, $postdata, &$response, $file_name, $file_field) {
- $c = curl_init($url);
- $postdata_str = dsq_get_query_string($postdata);
-
- $c_options = array(
- CURLOPT_USERAGENT => USER_AGENT,
- CURLOPT_RETURNTRANSFER => true,
- CURLOPT_POST => ($postdata_str ? 1 : 0),
- CURLOPT_HEADER => true,
- CURLOPT_HTTPHEADER => array('Expect:'),
- CURLOPT_TIMEOUT => SOCKET_TIMEOUT
- );
- if($postdata) {
- $c_options[CURLOPT_POSTFIELDS] = $postdata_str;
- }
- if($file_name && $file_field) {
- $postdata[$file_field] = '@' . $file_name;
- $c_options[CURLOPT_POSTFIELDS] = $postdata;
- $c_options[CURLOPT_RETURNTRANSFER] = 1;
- }
- curl_setopt_array($c, $c_options);
-
- $data = curl_exec($c);
- list($headers, $response['data']) = explode("\r\n\r\n", $data, 2);
-
- $response['headers'] = _dsq_get_response_headers($headers, $response);
- $response['code'] = curl_getinfo($c, CURLINFO_HTTP_CODE);
-}
-
-function _dsq_get_response_headers($headers, &$response) {
- $headers = explode("\r\n", $headers);
- list($unused, $response['code'], $unused) = explode(' ', $headers[0], 3);
- $headers = array_slice($headers, 1);
-
- // Convert headers into associative array.
- foreach($headers as $unused=>$header) {
- $header = explode(':', $header);
- $header[0] = trim($header[0]);
- $header[1] = trim($header[1]);
- $headers[strtolower($header[0])] = $header[1];
- }
-
- return $headers;
-}
-
-function _dsq_fsockopen_urlopen($url, $postdata, &$response, $file_name, $file_field) {
- $buf = '';
- $req = '';
- $length = 0;
- $boundary = '----------' . md5(time());
- $postdata_str = dsq_get_post_content($boundary, $postdata, $file_name, $file_field);
- $url_pieces = parse_url($url);
-
- // Set default port for supported schemes if none is provided.
- if(!isset($url_pieces['port'])) {
- switch($url_pieces['scheme']) {
- case 'http':
- $url_pieces['port'] = 80;
- break;
- case 'https':
- $url_pieces['port'] = 443;
- $url_pieces['host'] = 'ssl://' . $url_pieces['host'];
- break;
- }
- }
-
- // Set default path if trailing slash is not provided.
- if(!isset($url_pieces['path'])) { $url_pieces['path'] = '/'; }
-
- // Determine if we need to include the port in the Host header or not.
- if(($url_pieces['port'] == 80 && $url_pieces['scheme'] == 'http') ||
- ($url_pieces['port'] == 443 && $url_pieces['scheme'] == 'https')) {
- $host = $url_pieces['host'];
- } else {
- $host = $url_pieces['host'] . ':' . $url_pieces['port'];
- }
-
- $fp = @fsockopen($url_pieces['host'], $url_pieces['port'], $errno, $errstr, SOCKET_TIMEOUT);
- if(!$fp) { return false; }
-
- $path = $url_pieces['path'];
- if ($url_pieces['query']) $path .= '?'.$url_pieces['query'];
-
- $req .= ($postdata_str ? 'POST' : 'GET') . ' ' . $path . " HTTP/1.1\r\n";
- $req .= 'Host: ' . $host . "\r\n";
- $req .= dsq_get_http_headers_for_request($boundary, $postdata_str, $file_name, $file_field);
- if($postdata_str) {
- $req .= "\r\n\r\n" . $postdata_str;
- }
- $req .= "\r\n\r\n";
-
- fwrite($fp, $req);
- while(!feof($fp)) {
- $buf .= fgets($fp, 4096);
- }
-
- // Parse headers from the response buffers.
- list($headers, $response['data']) = explode("\r\n\r\n", $buf, 2);
-
- // Get status code from headers.
- $headers = _dsq_get_response_headers($headers, $response);
-
- // If transfer-coding is set to chunked, we need to join the message body
- // together.
- if(isset($headers['transfer-encoding']) && 'chunked' == strtolower($headers['transfer-encoding'])) {
- $chunk_data = $response['data'];
- $joined_data = '';
- while(true) {
- // Strip length from body.
- list($chunk_length, $chunk_data) = explode("\r\n", $chunk_data, 2);
- $chunk_length = hexdec($chunk_length);
- if(!$chunk_length || !strlen($chunk_data)) { break; }
-
- $joined_data .= substr($chunk_data, 0, $chunk_length);
- $chunk_data = substr($chunk_data, $chunk_length + 1);
- $length += $chunk_length;
- }
- $response['data'] = $joined_data;
- } else {
- $length = $headers['content-length'];
- }
- $response['headers'] = $headers;
-}
-
-
-function _dsq_fopen_urlopen($url, $postdata, &$response, $file_name, $file_field) {
- $params = array();
- if($file_name && $file_field) {
- $boundary = '----------' . md5(time());
- $content = dsq_get_post_content($boundary, $postdata, $file_name, $file_field);
- $header = dsq_get_http_headers_for_request($boundary, $content, $file_name, $file_field);
-
- $params = array('http' => array(
- 'method' => 'POST',
- 'header' => $header,
- 'content' => $content,
- 'timeout' => SOCKET_TIMEOUT
- ));
- } else {
- if($postdata) {
- $params = array('http' => array(
- 'method' => 'POST',
- 'header' => 'Content-Type: application/x-www-form-urlencoded',
- 'content' => dsq_get_query_string($postdata),
- 'timeout' => SOCKET_TIMEOUT
- ));
- }
- }
-
-
- ini_set('user_agent', USER_AGENT);
- $ctx = stream_context_create($params);
- $fp = fopen($url, 'rb', false, $ctx);
- if(!$fp) {
- return false;
- }
-
- // Get status code from headers.
- list($unused, $response['code'], $unused) = explode(' ', $http_response_header[0], 3);
- $headers = array_slice($http_response_header, 1);
-
- // Convert headers into associative array.
- foreach($headers as $unused=>$header) {
- $header = explode(':', $header);
- $header[0] = trim($header[0]);
- $header[1] = trim($header[1]);
- $headers[strtolower($header[0])] = strtolower($header[1]);
- }
-
- $response['data'] = stream_get_contents($fp);
- $response['headers'] = $headers;
-}
-
-
-/**
- * Wrapper to provide a single interface for making an HTTP request.
- *
- * Attempts to use cURL, fopen(), or fsockopen(), whichever is available
- * first.
- *
- * @param string $url URL to make request to.
- * @param array $postdata (optional) If postdata is provided, the request
- * method is POST with the key/value pairs as
- * the data.
- * @param array $file (optional) Should provide associative array
- * with two keys: name and field. Name should
- * be the name of the file and field is the name
- * of the field to POST.
- */
-function dsq_urlopen($url, $postdata=false, $file=false) {
- $response = array(
- 'data' => '',
- 'code' => 0
- );
-
- if($file) {
- extract($file, EXTR_PREFIX_ALL, 'file');
- }
- if(empty($file_name) || empty($file_field)) {
- $file_name = false;
- $file_field = false;
- }
-
-//
-
- // Try curl, fsockopen, fopen + stream (PHP5 only), exec wget
- if(function_exists('curl_init')) {
- if (!function_exists('curl_setopt_array')) {
- function curl_setopt_array(&$ch, $curl_options)
- {
- foreach ($curl_options as $option => $value) {
- if (!curl_setopt($ch, $option, $value)) {
- return false;
- }
- }
- return true;
- }
- }
- _dsq_curl_urlopen($url, $postdata, $response, $file_name, $file_field);
- } else if(ini_get('allow_url_fopen') && function_exists('stream_get_contents')) {
- _dsq_fopen_urlopen($url, $postdata, $response, $file_name, $file_field);
- } else {
- // TODO: Find the failure condition for fsockopen() (sockets?)
- _dsq_fsockopen_urlopen($url, $postdata, $response, $file_name, $file_field);
- }
-
-// returns array with keys data and code (from headers)
-
- return $response;
-}
-
-function dsq_url_method() {
- if(function_exists('curl_init')) {
- return 'curl';
- } else if(ini_get('allow_url_fopen') && function_exists('stream_get_contents')) {
- return 'fopen';
- } else {
- return 'fsockopen';
- }
-}
-?>
+$value) {
+ $postdata_str .= urlencode($key) . '=' . urlencode($value) . '&';
+ }
+ }
+
+ return $postdata_str;
+}
+
+
+function dsq_get_post_content($boundary, $postdata, $file_name, $file_field) {
+ if(empty($file_name) || empty($file_field)) {
+ return dsq_get_query_string($postdata);
+ }
+
+ $content = array();
+ $content[] = '--' . $boundary;
+ foreach($postdata as $key=>$value) {
+ $content[] = 'Content-Disposition: form-data; name="' . $key . '"' . "\r\n\r\n" . $value;
+ $content[] = '--' . $boundary;
+ }
+ $content[] = 'Content-Disposition: form-data; name="' . $file_field . '"; filename="' . $file_name . '"';
+ // HACK: We only need to handle text/plain files right now.
+ $content[] = "Content-Type: text/plain\r\n";
+ $content[] = file_get_contents($file_name);
+ $content[] = '--' . $boundary . '--';
+ $content = implode("\r\n", $content);
+ return $content;
+}
+
+
+function dsq_get_http_headers_for_request($boundary, $content, $file_name, $file_field) {
+ $headers = array();
+ $headers[] = 'User-Agent: ' . USER_AGENT;
+ $headers[] = 'Connection: close';
+ if($content) {
+ $headers[] = 'Content-Length: ' . strlen($content);
+ if($file_name && $file_field) {
+ $headers[] = 'Content-Type: multipart/form-data; boundary=' . $boundary;
+ } else {
+ $headers[] = 'Content-Type: application/x-www-form-urlencoded';
+ }
+ }
+ return implode("\r\n", $headers);
+}
+
+
+function _dsq_curl_urlopen($url, $postdata, &$response, $file_name, $file_field) {
+ $c = curl_init($url);
+ $postdata_str = dsq_get_query_string($postdata);
+
+ $c_options = array(
+ CURLOPT_USERAGENT => USER_AGENT,
+ CURLOPT_RETURNTRANSFER => true,
+ CURLOPT_POST => ($postdata_str ? 1 : 0),
+ CURLOPT_HEADER => true,
+ CURLOPT_HTTPHEADER => array('Expect:'),
+ CURLOPT_TIMEOUT => SOCKET_TIMEOUT
+ );
+ if($postdata) {
+ $c_options[CURLOPT_POSTFIELDS] = $postdata_str;
+ }
+ if($file_name && $file_field) {
+ $postdata[$file_field] = '@' . $file_name;
+ $c_options[CURLOPT_POSTFIELDS] = $postdata;
+ $c_options[CURLOPT_RETURNTRANSFER] = 1;
+ }
+ curl_setopt_array($c, $c_options);
+
+ $data = curl_exec($c);
+ list($headers, $response['data']) = explode("\r\n\r\n", $data, 2);
+
+ $response['headers'] = _dsq_get_response_headers($headers, $response);
+ $response['code'] = curl_getinfo($c, CURLINFO_HTTP_CODE);
+}
+
+function _dsq_get_response_headers($headers, &$response) {
+ $headers = explode("\r\n", $headers);
+ list($unused, $response['code'], $unused) = explode(' ', $headers[0], 3);
+ $headers = array_slice($headers, 1);
+
+ // Convert headers into associative array.
+ foreach($headers as $unused=>$header) {
+ $header = explode(':', $header);
+ $header[0] = trim($header[0]);
+ $header[1] = trim($header[1]);
+ $headers[strtolower($header[0])] = $header[1];
+ }
+
+ return $headers;
+}
+
+function _dsq_fsockopen_urlopen($url, $postdata, &$response, $file_name, $file_field) {
+ $buf = '';
+ $req = '';
+ $length = 0;
+ $boundary = '----------' . md5(time());
+ $postdata_str = dsq_get_post_content($boundary, $postdata, $file_name, $file_field);
+ $url_pieces = parse_url($url);
+
+ // Set default port for supported schemes if none is provided.
+ if(!isset($url_pieces['port'])) {
+ switch($url_pieces['scheme']) {
+ case 'http':
+ $url_pieces['port'] = 80;
+ break;
+ case 'https':
+ $url_pieces['port'] = 443;
+ $url_pieces['host'] = 'ssl://' . $url_pieces['host'];
+ break;
+ }
+ }
+
+ // Set default path if trailing slash is not provided.
+ if(!isset($url_pieces['path'])) { $url_pieces['path'] = '/'; }
+
+ // Determine if we need to include the port in the Host header or not.
+ if(($url_pieces['port'] == 80 && $url_pieces['scheme'] == 'http') ||
+ ($url_pieces['port'] == 443 && $url_pieces['scheme'] == 'https')) {
+ $host = $url_pieces['host'];
+ } else {
+ $host = $url_pieces['host'] . ':' . $url_pieces['port'];
+ }
+
+ $fp = @fsockopen($url_pieces['host'], $url_pieces['port'], $errno, $errstr, SOCKET_TIMEOUT);
+ if(!$fp) { return false; }
+
+ $path = $url_pieces['path'];
+ if ($url_pieces['query']) $path .= '?'.$url_pieces['query'];
+
+ $req .= ($postdata_str ? 'POST' : 'GET') . ' ' . $path . " HTTP/1.1\r\n";
+ $req .= 'Host: ' . $host . "\r\n";
+ $req .= dsq_get_http_headers_for_request($boundary, $postdata_str, $file_name, $file_field);
+ if($postdata_str) {
+ $req .= "\r\n\r\n" . $postdata_str;
+ }
+ $req .= "\r\n\r\n";
+
+ fwrite($fp, $req);
+ while(!feof($fp)) {
+ $buf .= fgets($fp, 4096);
+ }
+
+ // Parse headers from the response buffers.
+ list($headers, $response['data']) = explode("\r\n\r\n", $buf, 2);
+
+ // Get status code from headers.
+ $headers = _dsq_get_response_headers($headers, $response);
+
+ // If transfer-coding is set to chunked, we need to join the message body
+ // together.
+ if(isset($headers['transfer-encoding']) && 'chunked' == strtolower($headers['transfer-encoding'])) {
+ $chunk_data = $response['data'];
+ $joined_data = '';
+ while(true) {
+ // Strip length from body.
+ list($chunk_length, $chunk_data) = explode("\r\n", $chunk_data, 2);
+ $chunk_length = hexdec($chunk_length);
+ if(!$chunk_length || !strlen($chunk_data)) { break; }
+
+ $joined_data .= substr($chunk_data, 0, $chunk_length);
+ $chunk_data = substr($chunk_data, $chunk_length + 1);
+ $length += $chunk_length;
+ }
+ $response['data'] = $joined_data;
+ } else {
+ $length = $headers['content-length'];
+ }
+ $response['headers'] = $headers;
+}
+
+
+function _dsq_fopen_urlopen($url, $postdata, &$response, $file_name, $file_field) {
+ $params = array();
+ if($file_name && $file_field) {
+ $boundary = '----------' . md5(time());
+ $content = dsq_get_post_content($boundary, $postdata, $file_name, $file_field);
+ $header = dsq_get_http_headers_for_request($boundary, $content, $file_name, $file_field);
+
+ $params = array('http' => array(
+ 'method' => 'POST',
+ 'header' => $header,
+ 'content' => $content,
+ 'timeout' => SOCKET_TIMEOUT
+ ));
+ } else {
+ if($postdata) {
+ $params = array('http' => array(
+ 'method' => 'POST',
+ 'header' => 'Content-Type: application/x-www-form-urlencoded',
+ 'content' => dsq_get_query_string($postdata),
+ 'timeout' => SOCKET_TIMEOUT
+ ));
+ }
+ }
+
+
+ ini_set('user_agent', USER_AGENT);
+ $ctx = stream_context_create($params);
+ $fp = fopen($url, 'rb', false, $ctx);
+ if(!$fp) {
+ return false;
+ }
+
+ // Get status code from headers.
+ list($unused, $response['code'], $unused) = explode(' ', $http_response_header[0], 3);
+ $headers = array_slice($http_response_header, 1);
+
+ // Convert headers into associative array.
+ foreach($headers as $unused=>$header) {
+ $header = explode(':', $header);
+ $header[0] = trim($header[0]);
+ $header[1] = trim($header[1]);
+ $headers[strtolower($header[0])] = strtolower($header[1]);
+ }
+
+ $response['data'] = stream_get_contents($fp);
+ $response['headers'] = $headers;
+}
+
+
+/**
+ * Wrapper to provide a single interface for making an HTTP request.
+ *
+ * Attempts to use cURL, fopen(), or fsockopen(), whichever is available
+ * first.
+ *
+ * @param string $url URL to make request to.
+ * @param array $postdata (optional) If postdata is provided, the request
+ * method is POST with the key/value pairs as
+ * the data.
+ * @param array $file (optional) Should provide associative array
+ * with two keys: name and field. Name should
+ * be the name of the file and field is the name
+ * of the field to POST.
+ */
+function dsq_urlopen($url, $postdata=false, $file=false) {
+ $response = array(
+ 'data' => '',
+ 'code' => 0
+ );
+
+ if($file) {
+ extract($file, EXTR_PREFIX_ALL, 'file');
+ }
+ if(empty($file_name) || empty($file_field)) {
+ $file_name = false;
+ $file_field = false;
+ }
+
+//
+
+ // Try curl, fsockopen, fopen + stream (PHP5 only), exec wget
+ if(function_exists('curl_init')) {
+ if (!function_exists('curl_setopt_array')) {
+ function curl_setopt_array(&$ch, $curl_options)
+ {
+ foreach ($curl_options as $option => $value) {
+ if (!curl_setopt($ch, $option, $value)) {
+ return false;
+ }
+ }
+ return true;
+ }
+ }
+ _dsq_curl_urlopen($url, $postdata, $response, $file_name, $file_field);
+ } else if(ini_get('allow_url_fopen') && function_exists('stream_get_contents')) {
+ _dsq_fopen_urlopen($url, $postdata, $response, $file_name, $file_field);
+ } else {
+ // TODO: Find the failure condition for fsockopen() (sockets?)
+ _dsq_fsockopen_urlopen($url, $postdata, $response, $file_name, $file_field);
+ }
+
+// returns array with keys data and code (from headers)
+
+ return $response;
+}
+
+function dsq_url_method() {
+ if(function_exists('curl_init')) {
+ return 'curl';
+ } else if(ini_get('allow_url_fopen') && function_exists('stream_get_contents')) {
+ return 'fopen';
+ } else {
+ return 'fsockopen';
+ }
+}
+?>
diff --git a/wp-content/plugins/disqus-comment-system/lib/wp-api.php b/wp-content/plugins/disqus-comment-system/lib/wp-api.php
index 73f6cf0..add0e04 100644
--- a/wp-content/plugins/disqus-comment-system/lib/wp-api.php
+++ b/wp-content/plugins/disqus-comment-system/lib/wp-api.php
@@ -1,107 +1,107 @@
-
- * @copyright 2007-2010 Big Head Labs
- * @link http://disqus.com/
- * @package Disqus
- * @subpackage DisqusWordPressAPI
- * @version 2.0
- */
-
-require_once(ABSPATH.WPINC.'/http.php');
-require_once(dirname(__FILE__) . '/api/disqus/disqus.php');
-/** @#+
- * Constants
- */
-/**
- * Base URL for Disqus.
- */
-define('DISQUS_ALLOWED_HTML', '
If your API key has changed, you "
-"may need to reinstall Disqus (deactivate the plugin and then reactivate it). "
-"If you are still having issues, refer to the WordPress help page."
+"If your API key has changed, you may need to reinstall Disqus (deactivate "
+"the plugin and then reactivate it)."
msgstr ""
-#: ../disqus/disqus.php:461
+#: ../disqus/disqus.php:577
#, php-format
-msgid ""
-"Your comments have been sent to Disqus and queued for import! See the status of your import at Disqus"
+msgid "If you are still having issues, refer to the %s WordPress help page"
msgstr ""
-#: ../disqus/disqus.php:491
+#: ../disqus/disqus.php:608
+msgid ""
+"Unable to import comments. Make sure you are accessing this page from the "
+"Wordpress dashboard."
+msgstr ""
+
+#: ../disqus/disqus.php:631
msgid "There was an error downloading your comments from Disqus."
msgstr ""
-#: ../disqus/disqus.php:496
+#: ../disqus/disqus.php:636
msgid ""
"Your comments have been downloaded from Disqus and saved in your local "
"database."
msgstr ""
-#: ../disqus/disqus.php:499
+#: ../disqus/disqus.php:639
#, php-format
-msgid "Import in progress (last post id: %s) …"
+msgid "Import in progress (last post id: %s)"
msgstr ""
-#: ../disqus/disqus.php:833
+#: ../disqus/disqus.php:989
msgid "Pingback:"
msgstr ""
-#: ../disqus/disqus.php:833
-msgid "(Edit)"
+#: ../disqus/disqus.php:989
+msgid "Edit"
msgstr ""
-#: ../disqus/disqus.php:870
+#: ../disqus/disqus.php:1026
msgid "Configure"
msgstr ""
-#: ../disqus/disqus.php:872 ../disqus/manage.php:360
+#: ../disqus/disqus.php:1028 ../disqus/manage.php:394
msgid "Settings"
msgstr ""
-#: ../disqus/disqus.php:1577
+#: ../disqus/disqus.php:1492
msgid ""
"Sorry, the built-in commenting system is disabled because Disqus is active."
msgstr ""
-#: ../disqus/manage.php:61
+#: ../disqus/manage.php:62
msgid "Disqus Reset"
msgstr ""
-#: ../disqus/manage.php:64
+#: ../disqus/manage.php:65
msgid "Disqus has been reset successfully."
msgstr ""
-#: ../disqus/manage.php:66
+#: ../disqus/manage.php:67
msgid "Local settings for the plugin were removed."
msgstr ""
-#: ../disqus/manage.php:67
+#: ../disqus/manage.php:68
msgid "Database changes by Disqus were reverted."
msgstr ""
-#: ../disqus/manage.php:69
-msgid ""
-"If you wish to reinstall, you can do "
-"that now."
+#: ../disqus/manage.php:71
+msgid "If you wish to reinstall, you can do that now."
msgstr ""
-#: ../disqus/manage.php:182
+#: ../disqus/manage.php:72
+msgid "Reinstall"
+msgstr ""
+
+#: ../disqus/manage.php:189
msgid "Your settings have been changed."
msgstr ""
-#: ../disqus/manage.php:206
-msgid ""
-"There was an error completing the installation of Disqus. If you are still "
-"having issues, refer to the WordPress help page."
+#: ../disqus/manage.php:220
+msgid "There was an error completing the installation of Disqus."
msgstr ""
-#: ../disqus/manage.php:236
-#, php-format
-msgid ""
-"There aren't any sites associated with this account. Maybe you want to create a site?"
+#: ../disqus/manage.php:222
+msgid "If you are still having issues, refer to the help documentation."
msgstr ""
-#: ../disqus/manage.php:246
-msgid "Moderate"
-msgstr ""
-
-#: ../disqus/manage.php:246
-msgid "Install"
-msgstr ""
-
-#: ../disqus/manage.php:247
-msgid "Plugin Settings"
-msgstr ""
-
-#: ../disqus/manage.php:256 ../disqus/manage.php:267 ../disqus/manage.php:301
-msgid "Install Disqus Comments"
+#: ../disqus/manage.php:225
+msgid "WordPress Help Page"
msgstr ""
#: ../disqus/manage.php:258
+msgid ""
+"There aren't any sites associated with this account. Maybe you want to "
+"create a site?"
+msgstr ""
+
+#: ../disqus/manage.php:261
+msgid "Create a site"
+msgstr ""
+
+#: ../disqus/manage.php:274
+msgid "Moderate"
+msgstr ""
+
+#: ../disqus/manage.php:274
+msgid "Install"
+msgstr ""
+
+#: ../disqus/manage.php:277
+msgid "Plugin Settings"
+msgstr ""
+
+#: ../disqus/manage.php:287 ../disqus/manage.php:301 ../disqus/manage.php:335
+msgid "Install Disqus Comments"
+msgstr ""
+
+#: ../disqus/manage.php:289
msgid "Disqus has been installed on your blog."
msgstr ""
-#: ../disqus/manage.php:259
-msgid ""
-"If you have existing comments, you may wish to export them now. Otherwise, you're all set, and the "
-"Disqus network is now powering comments on your blog."
+#: ../disqus/manage.php:291
+msgid "If you have existing comments, you may wish to export them now."
msgstr ""
-#: ../disqus/manage.php:260
+#: ../disqus/manage.php:292
+msgid ""
+"Otherwise, you're all set, and the Disqus network is now powering comments "
+"on your site."
+msgstr ""
+
+#: ../disqus/manage.php:294
msgid "Continue to the moderation dashboard"
msgstr ""
-#: ../disqus/manage.php:273
+#: ../disqus/manage.php:307
msgid "Select a website"
msgstr ""
-#: ../disqus/manage.php:285
+#: ../disqus/manage.php:319
msgid "Or register a new one on the Disqus website."
msgstr ""
-#: ../disqus/manage.php:307
+#: ../disqus/manage.php:341
msgid "Username or email"
msgstr ""
-#: ../disqus/manage.php:310
-msgid "(don't have a Disqus Profile yet?)"
+#: ../disqus/manage.php:344
+msgid "don't have a Disqus Profile yet?"
msgstr ""
-#: ../disqus/manage.php:314
+#: ../disqus/manage.php:348
msgid "Password"
msgstr ""
-#: ../disqus/manage.php:317
-msgid "(forgot your password?)"
+#: ../disqus/manage.php:351
+msgid "forgot your password?"
msgstr ""
-#: ../disqus/manage.php:361
+#: ../disqus/manage.php:371
+msgid "Go to Disqus Moderation"
+msgstr ""
+
+#: ../disqus/manage.php:395
#, php-format
msgid "Version: %s"
msgstr ""
-#: ../disqus/manage.php:365
-msgid ""
-"
Disqus comments are currently disabled. (Enable)"
-"p>"
+#: ../disqus/manage.php:401
+msgid "Disqus comments are currently "
msgstr ""
-#: ../disqus/manage.php:367
-msgid ""
-"
Disqus comments are currently enabled. (Disable)"
-"p>"
+#: ../disqus/manage.php:404
+msgid "Disable"
msgstr ""
-#: ../disqus/manage.php:375
-msgid "
General
"
+#: ../disqus/manage.php:404
+msgid "Enable"
msgstr ""
-#: ../disqus/manage.php:378
+#: ../disqus/manage.php:413
+msgid "General"
+msgstr ""
+
+#: ../disqus/manage.php:416
msgid "Forum Shortname"
msgstr ""
-#: ../disqus/manage.php:383
+#: ../disqus/manage.php:421
msgid ""
"This is the unique identifier for your website in Disqus, automatically set "
"during installation."
msgstr ""
-#: ../disqus/manage.php:388
-msgid "
Appearance
"
+#: ../disqus/manage.php:426
+msgid "Appearance"
msgstr ""
-#: ../disqus/manage.php:391
+#: ../disqus/manage.php:429
msgid "Use Disqus Comments on"
msgstr ""
-#: ../disqus/manage.php:394
+#: ../disqus/manage.php:432
msgid "All blog posts."
msgstr ""
-#: ../disqus/manage.php:395
+#: ../disqus/manage.php:433
msgid "Blog posts with closed comments only."
msgstr ""
-#: ../disqus/manage.php:399
+#: ../disqus/manage.php:437
msgid ""
"You have selected to only enable Disqus on posts with closed comments. If "
-"you aren't seeing Disqus on new posts, change this option to All "
-"blog posts."
+"you aren't seeing Disqus on new posts, change this option to \"All blog posts"
+"\"."
msgstr ""
-#: ../disqus/manage.php:400
+#: ../disqus/manage.php:438
msgid ""
"Shows comments on either all blog posts, or ones with closed comments. "
-"Select the Blog posts with closed comments only option if "
-"you plan on disabling Disqus, but want to keep it on posts which already "
-"have comments."
+"Select the \"Blog posts with closed comments only\" option if you plan on "
+"disabling Disqus, but want to keep it on posts which already have comments."
msgstr ""
-#: ../disqus/manage.php:406
-msgid "
Sync
"
+#: ../disqus/manage.php:444
+msgid "Sync"
msgstr ""
-#: ../disqus/manage.php:409
+#: ../disqus/manage.php:447
msgid "Comment Importing"
msgstr ""
-#: ../disqus/manage.php:412
+#: ../disqus/manage.php:450
msgid "Disable automated comment importing"
msgstr ""
-#: ../disqus/manage.php:413
+#: ../disqus/manage.php:451
msgid ""
"If you have problems with WP-Cron taking too long, or have a large number of "
"comments, you may wish to disable automated sync. Comments will only be "
"imported to your local Wordpress database if you do so manually."
msgstr ""
-#: ../disqus/manage.php:417
+#: ../disqus/manage.php:455
msgid "Server-Side Rendering"
msgstr ""
-#: ../disqus/manage.php:420
+#: ../disqus/manage.php:458
msgid "Disable server-side rendering of comments"
msgstr ""
-#: ../disqus/manage.php:421
+#: ../disqus/manage.php:459
msgid "Hides comments from nearly all search engines."
msgstr ""
-#: ../disqus/manage.php:426
-msgid "
Patches
"
+#: ../disqus/manage.php:464
+msgid "Patches"
msgstr ""
-#: ../disqus/manage.php:430
+#: ../disqus/manage.php:468
+msgid "External Javascript Files"
+msgstr ""
+
+#: ../disqus/manage.php:471
+msgid "Render Javascript in external files"
+msgstr ""
+
+#: ../disqus/manage.php:472
+msgid ""
+"This will render the Disqus scripts as external files in the footer as "
+"recommended by Wordpress. Disable this if are not seeing Disqus appear on "
+"pages that normally have comments. This will fix the issue if your theme "
+"does not support the 'wp_enqueue_script' function, are caching your site on "
+"a CDN."
+msgstr ""
+
+#: ../disqus/manage.php:477
msgid "Template Conflicts"
msgstr ""
-#: ../disqus/manage.php:433
+#: ../disqus/manage.php:480
msgid "Output JavaScript in footer"
msgstr ""
-#: ../disqus/manage.php:434
-#, php-format
+#: ../disqus/manage.php:481
msgid ""
"Enable this if you have problems with comment counts or other "
"irregularities. For example: missing counts, counts always at 0, Disqus code "
"showing on the page, broken image carousels, or longer-than-usual home page "
-"load times (more info)."
+"load times"
msgstr ""
-#: ../disqus/manage.php:439
-#, php-format
-msgid ""
-"
Advanced
Single Sign-On
Allows users to log in to Disqus "
-"via WordPress. (More info on SSO)
"
+#: ../disqus/manage.php:487
+msgid "Advanced"
msgstr ""
-#: ../disqus/manage.php:443
+#: ../disqus/manage.php:488
+msgid "Single Sign-On"
+msgstr ""
+
+#: ../disqus/manage.php:490
+msgid "Allows users to log in to Disqus via WordPress."
+msgstr ""
+
+#: ../disqus/manage.php:492
+msgid "More info on SSO"
+msgstr ""
+
+#: ../disqus/manage.php:499
msgid "Disqus Partner Key"
msgstr ""
-#: ../disqus/manage.php:450
+#: ../disqus/manage.php:506
msgid "API Application Public Key"
msgstr ""
-#: ../disqus/manage.php:454 ../disqus/manage.php:462
-#, php-format
-msgid "Found at Disqus API Applications."
+#: ../disqus/manage.php:510 ../disqus/manage.php:518
+msgid "Disqus API Applications"
msgstr ""
-#: ../disqus/manage.php:458
+#: ../disqus/manage.php:514
msgid "API Application Secret Key"
msgstr ""
-#: ../disqus/manage.php:466
+#: ../disqus/manage.php:522
msgid "Custom Log-in Button"
msgstr ""
-#: ../disqus/manage.php:516
+#: ../disqus/manage.php:536
msgid "Change"
msgstr ""
-#: ../disqus/manage.php:516
+#: ../disqus/manage.php:536
msgid "Choose"
msgstr ""
-#: ../disqus/manage.php:516
+#: ../disqus/manage.php:536
msgid "button"
msgstr ""
-#: ../disqus/manage.php:522
-#, php-format
-msgid ""
-"Adds a button to the Disqus log-in interface. (Example "
-"screenshot.)"
+#: ../disqus/manage.php:542
+msgid "Adds a button to the Disqus log-in interface."
msgstr ""
-#: ../disqus/manage.php:523
-#, php-format
-msgid ""
-" See our SSO button documentation for a template to "
-"create your own button."
+#: ../disqus/manage.php:543
+msgid "Example screenshot"
msgstr ""
-#: ../disqus/manage.php:541
+#: ../disqus/manage.php:545
+msgid "See our documentation for a template to create your own button."
+msgstr ""
+
+#: ../disqus/manage.php:546
+msgid "SSO button documentation"
+msgstr ""
+
+#: ../disqus/manage.php:564
msgid "Export comments to Disqus"
msgstr ""
-#: ../disqus/manage.php:544
+#: ../disqus/manage.php:570
msgid "Export Comments"
msgstr ""
-#: ../disqus/manage.php:544
+#: ../disqus/manage.php:571
msgid "This will export your existing WordPress comments to Disqus"
msgstr ""
-#: ../disqus/manage.php:550
+#: ../disqus/manage.php:579
msgid "Sync Disqus with WordPress"
msgstr ""
-#: ../disqus/manage.php:554
+#: ../disqus/manage.php:586
msgid "Sync Comments"
msgstr ""
-#: ../disqus/manage.php:554
+#: ../disqus/manage.php:587
msgid ""
"This will download your Disqus comments and store them locally in WordPress"
msgstr ""
-#: ../disqus/manage.php:555
+#: ../disqus/manage.php:591
msgid "Remove all imported Disqus comments before syncing."
msgstr ""
-#: ../disqus/manage.php:566
+#: ../disqus/manage.php:605
msgid "Reset Disqus"
msgstr ""
-#: ../disqus/manage.php:570
+#: ../disqus/manage.php:610
msgid "Are you sure you want to reset the Disqus plugin?"
msgstr ""
-#: ../disqus/manage.php:570
+#: ../disqus/manage.php:611
msgid ""
"This removes all Disqus-specific settings. Comments will remain unaffected."
msgstr ""
-#: ../disqus/manage.php:571
+#: ../disqus/manage.php:613
msgid ""
"If you have problems with resetting taking too long you may wish to first "
-"manually drop the disqus_dupecheck index from your "
-"commentmeta table."
+"manually drop the 'disqus_dupecheck' index from your 'commentmeta' table."
msgstr ""
-#: ../disqus/manage.php:578
+#: ../disqus/manage.php:620
msgid "Debug Information"
msgstr ""
-#: ../disqus/manage.php:579
-#, php-format
+#: ../disqus/manage.php:622
msgid ""
-"Having problems with the plugin? Check out our WordPress Troubleshooting "
-"documentation. You can also drop us a line including the "
-"following details and we'll do what we can."
+"Having problems with the plugin? Check out our troubleshooting documentation."
+msgstr ""
+
+#: ../disqus/manage.php:623
+msgid "WordPress troubleshooting ocumentation"
+msgstr ""
+
+#: ../disqus/manage.php:624
+msgid "You can also email us and include the debug info below."
+msgstr ""
+
+#: ../disqus/manage.php:625
+msgid "Contact support"
msgstr ""
#: ../disqus/upgrade.php:12
diff --git a/wp-content/plugins/disqus-comment-system/locales/index.html b/wp-content/plugins/disqus-comment-system/locales/index.html
deleted file mode 100644
index e69de29..0000000
diff --git a/wp-content/plugins/disqus-comment-system/manage.php b/wp-content/plugins/disqus-comment-system/manage.php
index 0b5ffa4..e6f696a 100644
--- a/wp-content/plugins/disqus-comment-system/manage.php
+++ b/wp-content/plugins/disqus-comment-system/manage.php
@@ -1,621 +1,668 @@
- $value ) {
- if ( isset($_POST[$nonce_form_prefix.$value]) ) {
- check_admin_referer($nonce_action_prefix.$value, $nonce_form_prefix.$value);
- return true;
- }
- }
-
- return false;
-}
-
-if ( ! empty($_POST) ) {
- $nonce_result_check = has_valid_nonce();
- if ($nonce_result_check === false) {
- die('Unable to save changes. Make sure you are accessing this page from the Wordpress dashboard.');
- }
-}
-
-if( isset($_POST['dsq_username']) ) {
- $_POST['dsq_username'] = stripslashes($_POST['dsq_username']);
-}
-
-if( isset($_POST['dsq_password']) ) {
- $_POST['dsq_password'] = stripslashes($_POST['dsq_password']);
-}
-
-// Handle export function.
-if( isset($_POST['export']) and DISQUS_CAN_EXPORT ) {
- require_once(dirname(__FILE__) . '/export.php');
- dsq_export_wp();
-}
-
-// Handle resetting.
-if ( isset($_POST['reset']) ) {
- foreach (dsq_options() as $opt) {
- delete_option($opt);
- }
- unset($_POST);
- dsq_reset_database();
-?>
-
WordPress Troubleshooting documentation. You can also drop us a line including the following details and we\'ll do what we can.', 'https://help.disqus.com/customer/portal/articles/472005-wordpress-troubleshooting', 'mailto:help+wp@disqus.com'); ?>
diff --git a/wp-content/plugins/disqus-comment-system/media/js/admin.js b/wp-content/plugins/disqus-comment-system/media/js/admin.js
new file mode 100644
index 0000000..469ac17
--- /dev/null
+++ b/wp-content/plugins/disqus-comment-system/media/js/admin.js
@@ -0,0 +1,120 @@
+jQuery(document).ready(function($) {
+
+ // Replace comments dashboard link
+ $('#dashboard_right_now .inside table td.last a, #dashboard_recent_comments .inside .textright a.button').attr('href', 'edit-comments.php?page=disqus');
+
+ // Focuses on username text box if present
+ if ($('#dsq-username').length) {
+ $('#dsq-username').focus();
+ }
+
+ // Set current Disqus admin state
+ $('#dsq-tabs li').click(function() {
+ $('#dsq-tabs li.selected').removeClass('selected');
+ $(this).addClass('selected');
+ $('.dsq-main, .dsq-advanced').hide();
+ $('.' + $(this).attr('rel')).show();
+ });
+ if (location.href.indexOf('#adv') != -1) {
+ $('#dsq-tab-advanced').click();
+ }
+
+ // Bind click events to export/sync buttons
+ dsq_fire_export();
+ dsq_fire_import();
+});
+
+var dsq_fire_export = function() {
+ jQuery(function($) {
+ $('#dsq_export a.button').unbind().click(function() {
+ $('#dsq_export .status').removeClass('dsq-export-fail').addClass('dsq-exporting').html('Processing...');
+ dsq_export_comments();
+ return false;
+ });
+ });
+};
+
+var dsq_export_comments = function() {
+ jQuery(function($) {
+ var status = $('#dsq_export .status');
+ var nonce = $('#dsq-form_nonce_export').val();
+ var export_info = (status.attr('rel') || '0|' + (new Date().getTime()/1000)).split('|');
+ $.get(
+ adminVars.indexUrl,
+ {
+ cf_action: 'export_comments',
+ post_id: export_info[0],
+ timestamp: export_info[1],
+ _dsqexport_wpnonce: nonce
+ },
+ function(response) {
+ switch (response.result) {
+ case 'success':
+ status.html(response.msg).attr('rel', response.post_id + '|' + response.timestamp);
+ switch (response.status) {
+ case 'partial':
+ dsq_export_comments();
+ break;
+ case 'complete':
+ status.removeClass('dsq-exporting').addClass('dsq-exported');
+ break;
+ }
+ break;
+ case 'fail':
+ status.parent().html(response.msg);
+ dsq_fire_export();
+ break;
+ }
+ },
+ 'json'
+ );
+ });
+};
+
+var dsq_fire_import = function() {
+ jQuery(function($) {
+ $('#dsq_import a.button, #dsq_import_retry').unbind().click(function() {
+ var wipe = $('#dsq_import_wipe').is(':checked');
+ $('#dsq_import .status').removeClass('dsq-import-fail').addClass('dsq-importing').html('Processing...');
+ dsq_import_comments(wipe);
+ return false;
+ });
+ });
+};
+
+var dsq_import_comments = function(wipe) {
+ jQuery(function($) {
+ var status = $('#dsq_import .status');
+ var nonce = $('#dsq-form_nonce_import').val();
+ var last_comment_id = status.attr('rel') || '0';
+ $.get(
+ adminVars.indexUrl,
+ {
+ cf_action: 'import_comments',
+ last_comment_id: last_comment_id,
+ wipe: (wipe ? 1 : 0),
+ _dsqimport_wpnonce: nonce
+ },
+ function(response) {
+ switch (response.result) {
+ case 'success':
+ status.html(response.msg).attr('rel', response.last_comment_id);
+ switch (response.status) {
+ case 'partial':
+ dsq_import_comments(false);
+ break;
+ case 'complete':
+ status.removeClass('dsq-importing').addClass('dsq-imported');
+ break;
+ }
+ break;
+ case 'fail':
+ status.parent().html(response.msg);
+ dsq_fire_import();
+ break;
+ }
+ },
+ 'json'
+ );
+ });
+};
diff --git a/wp-content/plugins/disqus-comment-system/media/js/count.js b/wp-content/plugins/disqus-comment-system/media/js/count.js
new file mode 100644
index 0000000..7a3b8ae
--- /dev/null
+++ b/wp-content/plugins/disqus-comment-system/media/js/count.js
@@ -0,0 +1,17 @@
+var disqus_shortname = countVars.disqusShortname;
+(function () {
+ var nodes = document.getElementsByTagName('span');
+ for (var i = 0, url; i < nodes.length; i++) {
+ if (nodes[i].className.indexOf('dsq-postid') != -1) {
+ nodes[i].parentNode.setAttribute('data-disqus-identifier', nodes[i].getAttribute('data-dsqidentifier'));
+ url = nodes[i].parentNode.href.split('#', 1);
+ if (url.length == 1) { url = url[0]; }
+ else { url = url[1]; }
+ nodes[i].parentNode.href = url + '#disqus_thread';
+ }
+ }
+ var s = document.createElement('script'); s.async = true;
+ s.type = 'text/javascript';
+ s.src = '//' + disqus_shortname + '.disqus.com/count.js';
+ (document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s);
+}());
diff --git a/wp-content/plugins/disqus-comment-system/media/js/dashboard.js b/wp-content/plugins/disqus-comment-system/media/js/dashboard.js
new file mode 100644
index 0000000..efa9993
--- /dev/null
+++ b/wp-content/plugins/disqus-comment-system/media/js/dashboard.js
@@ -0,0 +1,15 @@
+jQuery(document).ready(function($) {
+
+ // fix menu
+ var mc = $('#menu-comments');
+ mc.find('a.wp-has-submenu').attr('href', 'edit-comments.php?page=disqus').end().find('.wp-submenu li:has(a[href="edit-comments.php?page=disqus"])').prependTo(mc.find('.wp-submenu ul'));
+
+ // fix admin bar
+ $('#wp-admin-bar-comments').find('a.ab-item').attr('href', 'edit-comments.php?page=disqus');
+
+ // Remove trackbacks
+ $('#dashboard_recent_comments div.trackback').remove();
+
+ // Replace comment counts
+ $('#dashboard_right_now').find('.b-comments a').html(dashboardVars.stats.totalComments).end().find('.b_approved a').html(dashboardVars.stats.approved).end().find('.b-waiting a').html(dashboardVars.stats.moderated).end().find('.b-spam a').html(dashboardVars.stats.spam);
+});
diff --git a/wp-content/plugins/disqus-comment-system/media/js/disqus.js b/wp-content/plugins/disqus-comment-system/media/js/disqus.js
new file mode 100644
index 0000000..5d0a1a9
--- /dev/null
+++ b/wp-content/plugins/disqus-comment-system/media/js/disqus.js
@@ -0,0 +1,56 @@
+var disqus_url = embedVars.disqusUrl;
+var disqus_identifier = embedVars.disqusIdentifier;
+var disqus_container_id = 'disqus_thread';
+var disqus_shortname = embedVars.disqusShortname;
+var disqus_title = embedVars.disqusTitle;
+var disqus_config_custom = window.disqus_config;
+var disqus_config = function () {
+ /*
+ All currently supported events:
+ onReady: fires when everything is ready,
+ onNewComment: fires when a new comment is posted,
+ onIdentify: fires when user is authenticated
+ */
+ if (typeof embedVars.disqusConfig.remote_auth_s3 !== 'undefined') {
+ this.page.remote_auth_s3 = embedVars.disqusConfig.remote_auth_s3;
+ }
+
+ if (typeof embedVars.disqusConfig.api_key !== 'undefined') {
+ this.page.api_key = embedVars.disqusConfig.api_key;
+ }
+
+ if (typeof embedVars.disqusConfig.sso !== 'undefined') {
+ this.sso = {
+ name: embedVars.disqusConfig.sso.name,
+ button: embedVars.disqusConfig.sso.button,
+ url: embedVars.disqusConfig.sso.url,
+ logout: embedVars.disqusConfig.sso.logout,
+ width: embedVars.disqusConfig.sso.width,
+ height: embedVars.disqusConfig.sso.height
+ };
+ }
+
+ this.language = embedVars.disqusConfig.language;
+ this.callbacks.onReady.push(function () {
+ if (!embedVars.options.manualSync) {
+ // sync comments in the background so we don't block the page
+ var script = document.createElement('script');
+ script.async = true;
+ script.src = '?cf_action=sync_comments&post_id=' + embedVars.postId;
+
+ var firstScript = document.getElementsByTagName('script')[0];
+ firstScript.parentNode.insertBefore(script, firstScript);
+ }
+ });
+
+ if (disqus_config_custom) {
+ disqus_config_custom.call(this);
+ }
+};
+
+(function() {
+ var dsq = document.createElement('script'); dsq.type = 'text/javascript';
+ dsq.async = true;
+ dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
+ (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
+})();
diff --git a/wp-content/plugins/disqus-comment-system/media/js/pointer.js b/wp-content/plugins/disqus-comment-system/media/js/pointer.js
new file mode 100644
index 0000000..6be37a8
--- /dev/null
+++ b/wp-content/plugins/disqus-comment-system/media/js/pointer.js
@@ -0,0 +1,19 @@
+jQuery(document).ready( function($) {
+ alert('pointer.js loaded');
+ console.log('pointerContent', pointerContent);
+
+ $('#menu-comments').pointer({
+ content: pointerContent,
+ position: {
+ edge: 'left', // arrow direction
+ align: 'center' // vertical alignment
+ },
+ pointerWidth: 350,
+ close: function() {
+ $.post(ajaxurl, {
+ pointer: 'disqus_settings_pointer', // pointer ID
+ action: 'dismiss-wp-pointer'
+ });
+ }
+ }).pointer('open');
+});
diff --git a/wp-content/plugins/disqus-comment-system/media/js/upload.js b/wp-content/plugins/disqus-comment-system/media/js/upload.js
new file mode 100644
index 0000000..4976be2
--- /dev/null
+++ b/wp-content/plugins/disqus-comment-system/media/js/upload.js
@@ -0,0 +1,34 @@
+var file_frame;
+
+jQuery(document).ready(function($) {
+ $('.upload_image_button').on('click', function(event) {
+ event.preventDefault();
+
+ // If the media frame already exists, reopen it.
+ if ( file_frame ) {
+ file_frame.open();
+ return;
+ }
+
+ // Create the media frame.
+ file_frame = wp.media.frames.file_frame = wp.media({
+ title: $(this).data('uploader_title'),
+ button: {
+ text: $(this).data('uploader_button_text'),
+ },
+ multiple: false // Set to true to allow multiple files to be selected
+ });
+
+ // When an image is selected, run a callback.
+ file_frame.on('select', function() {
+ // We set multiple to false so only get one image from the uploader
+ attachment = file_frame.state().get('selection').first().toJSON();
+
+ // Do something with attachment.id and/or attachment.url here
+ $('#disqus_sso_button').val(attachment.url);
+ });
+
+ // Finally, open the modal
+ file_frame.open();
+ });
+});
diff --git a/wp-content/plugins/disqus-comment-system/media/styles/manage-pre25.css b/wp-content/plugins/disqus-comment-system/media/styles/manage-pre25.css
index 47950c1..8d006eb 100644
--- a/wp-content/plugins/disqus-comment-system/media/styles/manage-pre25.css
+++ b/wp-content/plugins/disqus-comment-system/media/styles/manage-pre25.css
@@ -1,67 +1,67 @@
-/* Selectors required for pre-WordPress 2.5 */
-
-.form-table {
- border-collapse: collapse;
- margin-top: 1em;
- width: 100%;
- color: #333;
-}
-
-.form-table tr {
- background-color: #eaf3fa;
-}
-
-.form-table td {
- margin-bottom: 9px;
- padding: 10px;
- line-height: 20px;
- font-size: 11px;
- border-bottom-width: 8px;
- border-bottom-style: solid;
- border-color: #fff;
-}
-
-.form-table th {
- vertical-align: top;
- text-align: left;
- padding: 10px;
- width: 150px;
- border-bottom-width: 8px;
- border-bottom-style: solid;
- border-color: #fff;
-}
-
-.form-table th.th-full {
- width: auto;
-}
-
-.form-table input, .form-table textarea {
- border-width: 1px;
- border-style: solid;
-}
-
-.form-table div.color-option {
- display: block;
- clear: both;
-}
-
-.form-table input.tog {
- margin-top: 2px;
- margin-right: 2px;
- float: left;
-}
-
-.form-table table.color-palette {
- vertical-align: bottom;
- float: left;
- margin: -3px 3px 8px;
-}
-
-.form-table .color-palette td {
- border-bottom: none;
- border: 1px solid #fff;
- font-size: 1px;
- line-height: 1px;
-}
-
-#disqus_warning{ background-color:#ff0000; }
+/* Selectors required for pre-WordPress 2.5 */
+
+.form-table {
+ border-collapse: collapse;
+ margin-top: 1em;
+ width: 100%;
+ color: #333;
+}
+
+.form-table tr {
+ background-color: #eaf3fa;
+}
+
+.form-table td {
+ margin-bottom: 9px;
+ padding: 10px;
+ line-height: 20px;
+ font-size: 11px;
+ border-bottom-width: 8px;
+ border-bottom-style: solid;
+ border-color: #fff;
+}
+
+.form-table th {
+ vertical-align: top;
+ text-align: left;
+ padding: 10px;
+ width: 150px;
+ border-bottom-width: 8px;
+ border-bottom-style: solid;
+ border-color: #fff;
+}
+
+.form-table th.th-full {
+ width: auto;
+}
+
+.form-table input, .form-table textarea {
+ border-width: 1px;
+ border-style: solid;
+}
+
+.form-table div.color-option {
+ display: block;
+ clear: both;
+}
+
+.form-table input.tog {
+ margin-top: 2px;
+ margin-right: 2px;
+ float: left;
+}
+
+.form-table table.color-palette {
+ vertical-align: bottom;
+ float: left;
+ margin: -3px 3px 8px;
+}
+
+.form-table .color-palette td {
+ border-bottom: none;
+ border: 1px solid #fff;
+ font-size: 1px;
+ line-height: 1px;
+}
+
+#disqus_warning{ background-color:#ff0000; }
diff --git a/wp-content/plugins/disqus-comment-system/media/styles/manage.css b/wp-content/plugins/disqus-comment-system/media/styles/manage.css
index 5226cfb..f080124 100644
--- a/wp-content/plugins/disqus-comment-system/media/styles/manage.css
+++ b/wp-content/plugins/disqus-comment-system/media/styles/manage.css
@@ -1,52 +1,52 @@
-ul#dsq-tabs li:last-child {
- width: 100px;
-}
-ul#dsq-tabs li.selected {
- font-weight: bold;
-}
-ul#dsq-tabs li {
- float: left;
- color: #333;
- padding: 0.25em;
- height: 16px;
- cursor: pointer;
- margin-right: 8px;
- text-align: right;
-}
-
-ul#dsq-tabs {
- display: block;
- height: 20px;
- list-style: none;
- margin: 15px 0;
- padding: 0;
- border: 0;
- position: absolute;
- right: 10px;
-}
-
-select.disqus-replace {
- border-color: #C6D9E9;
-}
-
-.dsq-content h2 {
- line-height: 41px;
- margin: 15px 0 10px;
-}
-
-.dsq-alert {
- color: #fff;
- background: #e76c35;
- border: 1px solid #8f3e1c;
- padding: 5px;
-}
-
-.dsq-disabled-text {
- color: #e76c35;
- font-weight: 700;
-}
-
-.dsq-enabled-text {
- color: #7fbd5a;
- font-weight: 700;
+ul#dsq-tabs li:last-child {
+ width: 100px;
+}
+ul#dsq-tabs li.selected {
+ font-weight: bold;
+}
+ul#dsq-tabs li {
+ float: left;
+ color: #333;
+ padding: 0.25em;
+ height: 16px;
+ cursor: pointer;
+ margin-right: 8px;
+ text-align: right;
+}
+
+ul#dsq-tabs {
+ display: block;
+ height: 20px;
+ list-style: none;
+ margin: 15px 0;
+ padding: 0;
+ border: 0;
+ position: absolute;
+ right: 10px;
+}
+
+select.disqus-replace {
+ border-color: #C6D9E9;
+}
+
+.dsq-content h2 {
+ line-height: 41px;
+ margin: 15px 0 10px;
+}
+
+.dsq-alert {
+ color: #fff;
+ background: #e76c35;
+ border: 1px solid #8f3e1c;
+ padding: 5px;
+}
+
+.dsq-disabled-text {
+ color: #e76c35;
+ font-weight: 700;
+}
+
+.dsq-enabled-text {
+ color: #7fbd5a;
+ font-weight: 700;
}
\ No newline at end of file
diff --git a/wp-content/plugins/disqus-comment-system/readme.txt b/wp-content/plugins/disqus-comment-system/readme.txt
index d9cd667..a3d77e4 100644
--- a/wp-content/plugins/disqus-comment-system/readme.txt
+++ b/wp-content/plugins/disqus-comment-system/readme.txt
@@ -1,293 +1,321 @@
-=== Disqus Comment System ===
-Contributors: disqus, alexkingorg, crowdfavorite, zeeg, tail, thetylerhayes
-Tags: comments, threaded, email, notification, spam, avatars, community, profile, widget, disqus
-Requires at least: 2.8
-Tested up to: 3.9.1
-Stable tag: 2.77
-
-The Disqus comment system replaces your WordPress comment system with your comments hosted and powered by Disqus.
-
-== Description ==
-
-Disqus, pronounced "discuss", is a service and tool for web comments and
-discussions. Disqus makes commenting easier and more interactive,
-while connecting websites and commenters across a thriving discussion
-community.
-
-The Disqus for WordPress plugin seamlessly integrates using the Disqus API and by syncing with WordPress comments.
-
-= Disqus for WordPress =
-
-* Uses the Disqus API
-* Comments indexable by search engines (SEO-friendly)
-* Support for importing existing comments
-* Auto-sync (backup) of comments with Disqus and WordPress database
-
-= Disqus Features =
-
-* Threaded comments and replies
-* Notifications and reply by email
-* Subscribe and RSS options
-* Aggregated comments and social mentions
-* Powerful moderation and admin tools
-* Full spam filtering, blacklists and whitelists
-* Support for Disqus community widgets
-* Connected with a large discussion community
-* Increased exposure and readership
-
-== Installation ==
-
-**NOTE: It is recommended that you [backup your database](http://codex.wordpress.org/Backing_Up_Your_Database) before installing the plugin.**
-
-1. Unpack archive to this archive to the 'wp-content/plugins/' directory inside
- of WordPress
-
- * Maintain the directory structure of the archive (all extracted files
- should exist in 'wp-content/plugins/disqus-comment-system/'
-
-2. From your blog administration, click on Comments to change settings
- (WordPress 2.0 users can find the settings under Options > Disqus.)
-
-= More documentation =
-
-Go to [http://disqus.com/help/wordpress](http://disqus.com/help/wordpress)
-
-== Screenshots ==
-
-1. Disqus Comments
-2. Discovery Box (part of Disqus Comments)
-3. Inline Moderation Interface
-
-== Changes ==
-
-2.77
-
-* Fixes login by email issue
-* Make sure Disqus is enabled after installation
-* Additional security fixes
-
-2.76
-
-* Security fixes (Thanks to Nik Cubrilovic, Alexander Concha and Marc-Alexandre Montpas)
-* Bump tested Wordpress version to 3.9.1
-* Remove obsolete SSO button uploader
-* Enable 'Output javascript in footer' by default during installation
-* Fix for 'Reset' function not completely working the first time
-
-2.75
-
-* Bump supported WordPress version to 3.8.
-* Properly encode site name for SSO login button.
-* Increased timeout for comment exporter to 60 seconds.
-* Use https: for admin pages
-* Miscellaneous bug fixes and improvements.
-
-2.74
-
-* Updated settings UI
-* Add filter hook for setting custom Disqus language
-* For WP >= 3.5, use new media uploader
-* Disable internal Wordpress commenting if Disqus is enabled (thanks Artem Russakovskii)
-* Cleaned up installation and configuration flow
-* Added link to WP backup guide in README
-* Fix admin bar comments link
-* Added a check to avoid a missing key notice when WP_DEBUG=TRUE (thanks Jason Lengstorf)
-* Prevent 404 errors for embed.js from being reported by Google Webmaster Tools (missed in 2.73 README)
-
-2.73
-
-* Apply CDATA patch from Wordpress 3.4 to dsq_export_wxr_cdata() (thanks Artem
- Russakovskii for the patch).
-* Added Single Sign-On log-in button and icon to options (only for sites using SSO)
-* Output user website if set in SSO payload
-* Added plugin activation statuses to debug info
-* Bump supported WordPress version to 3.4.1
-* Fixed issue where disqus_dupecheck won't properly uninstall
-* Load second count.js (output-in-footer version) reference via SSL too
-* Added screenshots
-
-2.72
-
-* Load count.js via SSL when page is accessed via HTTPS
-* Fixed styling issue with Disqus admin.
-
-2.71
-
-* Fixed issue where embed wasn't using SSL if page was loaded via HTTPS
-* Fixed issue with syncing where to user's without a display_name would
- revert back to Anonymous (really this time).
-* Fixed issue where Google Webmaster Tools would incorrectly report 404s.
-* Fixed issue with Disqus admin display issues.
-
-2.70
-
-* Properly uninstall disqus_dupecheck index when uninstalling plugin.
-* Fixed issue with syncing where to user's without a display_name would
- revert back to Anonymous.
-* Fixed issue where IP addresses weren't being synced properly.
-* Allow non-Administrators (e.g., editors) to see Disqus Moderate panel
- inline (fixes GH-3)
-
-2.69
-
-* Bumped version number.
-
-2.68
-
-* Removed debugging information from web requests in CLI scripts (thanks
- Ryan Dewhurst for the report).
-* Reduced sync lock time to 1 hour.
-* Fixed an issue which was not allowing pending posts (for sync) to clear.
-* Fixed an issue with CLI scripts when used with certain caching plugins.
-
-2.67
-
-* Bumped synchronization timer delays to 5 minutes.
-* wp-cli.php now requires php_sapi_name to be set to 'cli' for execution.
-* Fixed a bug with imported comments not storing the correct relative date.
-* Added a lock for dsq_sync_forum, which can be overriden in the command line script
- with the --force tag.
-* dsq_sync_forum will now handle all pending post metadata updates (formerly a separate
- cron task, dsq_sync_post).
-
-2.66
-
-* Fixed issue with jQuery usage which conflicted with updated jQuery version.
-
-2.65
-
-* Corrected a bug that was causing posts to not appear due to invalid references.
-
-2.64
-
-* Added an option to disable Disqus without deactivating the plugin.
-* Added a second check for comment sync to prevent stampede race conditions in WP cron.
-
-2.63
-
-* Added command line script to import comments from DISQUS (scripts/import-comments.php).
-* Added command line script to export comments to DISQUS (scripts/export-comments.php).
-* The exporter will now only do one post at a time.
-* The exporter now only sends required attributes to DISQUS.
-* Moved media into its own directory.
-
-2.62
-
-* Changed legacy query to use = operator instead of LIKE so it can be indexed.
-
-2.61
-
-* Fixed an issue which was causing invalid information to be presented in RSS feeds.
-
-2.60
-
-* Added support for new Single Sign-On (API version 3.0).
-* Improved support for legacy Single Sign-On.
-
-2.55
-
-* Added support for get_comments_number in templates.
-
-2.54
-
-* Updated URL to forum moderation.
-
-2.53
-
-* Fixed an issue with fsockopen and GET requests (only affects certain users).
-
-2.52
-
-* Fixed issue with Disqus-API package not getting updated (only affecting PHP4).
-
-2.51
-
-* Added CDATA comments for JavaScript.
-* Syncing comments will now restore missing thread information from old imports.
-* Install and uninstall processes have been improved.
-* Fixed an issue in PHP4 with importing comments.
-* Fixed an issue that could cause duplicate comments in some places.
-* Added an option to remove existing imported comments when importing.
-
-2.50
-
-* Added missing file.
-
-2.49
-
-* Database usage has been optimized for storing comment meta data.
-
-You can perform this migration automatically by visiting Comments -> Disqus, or if
-you have a large database, you may do this by hand:
-
-CREATE INDEX disqus_dupecheck ON `wp_commentmeta` (meta_key, meta_value(11));
-INSERT INTO `wp_options` (blog_id, option_name, option_value, autoload) VALUES (0, 'disqus_version', '2.49', 'yes') ON DUPLICATE KEY UPDATE option_value = VALUES(option_value);
-
-2.48
-
-* Comment synchronization has been optimized to be a single call per-site.
-* disqus.css will now only load when displaying comments
-
-2.47
-
-* Fixed a security hole with comment importing.
-* Reverted ability to use default template comments design.
-* Comments will now store which version they were imported under.
-* Added an option to disable server side rendering.
-
-2.46
-
-* Better debugging information for export errors.
-* Added the ability to manual import Disqus comments into Wordpress.
-* Added thread_identifier support to exports.
-* Cleaned up API error messages.
-* Fixed a bug which was causing the import process to not grab only the latest set of comments.
-* Added an option to disable automated synchronization with Disqus.
-
-2.45
-
-* Comments should now store thread information as well as certain other meta data.
-* Optimize get_thread polling to only pull comments which aren't stored properly.
-
-2.44
-
-* Fixed JavaScript response for comments sync call.
-* Comments are now marked as closed while showing the embed (fixes showing default respond form).
-
-2.43
-
-* Fixed a JavaScript syntax error which would cause linting to fail.
-* Correct an issue that was causing comments.php to throw a syntax error under some configurations.
-
-2.42
-
-* Correct a bug with saving disqus_user_api_key (non-critical).
-* Added settings to Debug Information.
-* Adjusting all includes to use absolute paths.
-* Adjusted JSON usage to solve a problem for some clients.
-
-2.41
-
-* Correct a bug with double urlencoding titles.
-
-2.40
-
-* Comments are now synced with Disqus as a delayed asynchronous cron event.
-* Comment count code has been updated to use the new widget. (Comment counts
- must be linked to get tracked within "the loop" now).
-* API bindings have been migrated to the generic 1.1 Disqus API.
-* Pages will now properly update their permalink with Disqus when it changes. This is
- done within the sync event above.
-* There is now a Debug Information pane under Advanced to assist with support requests.
-* When Disqus is unreachable it will fallback to the theme's built-in comment display.
-* Legacy mode is no longer available.
-* The plugin management interface can now be localized.
-* The plugin is now valid HTML5.
-
-== Support ==
-
-* Visit http://disqus.com/help/wordpress for help documentation.
-
-* Visit http://help.disqus.com for help from our support team.
-
-* Disqus also recommends the [WordPress HelpCenter](http://wphelpcenter.com/) for extended help. Disqus is not associated with the WordPress HelpCenter in any way.
+=== Disqus Comment System ===
+Contributors: disqus, alexkingorg, crowdfavorite, zeeg, tail, thetylerhayes
+Tags: comments, threaded, email, notification, spam, avatars, community, profile, widget, disqus
+Requires at least: 2.8
+Tested up to: 4.0
+Stable tag: 2.83
+
+The Disqus comment system replaces your WordPress comment system with your comments hosted and powered by Disqus.
+
+== Description ==
+
+Disqus, pronounced "discuss", is a service and tool for web comments and
+discussions. Disqus makes commenting easier and more interactive,
+while connecting websites and commenters across a thriving discussion
+community.
+
+The Disqus for WordPress plugin seamlessly integrates using the Disqus API and by syncing with WordPress comments.
+
+= Disqus for WordPress =
+
+* Uses the Disqus API
+* Comments indexable by search engines (SEO-friendly)
+* Support for importing existing comments
+* Auto-sync (backup) of comments with Disqus and WordPress database
+
+= Disqus Features =
+
+* Threaded comments and replies
+* Notifications and reply by email
+* Subscribe and RSS options
+* Aggregated comments and social mentions
+* Powerful moderation and admin tools
+* Full spam filtering, blacklists and whitelists
+* Support for Disqus community widgets
+* Connected with a large discussion community
+* Increased exposure and readership
+
+== Installation ==
+
+**NOTE: It is recommended that you [backup your database](http://codex.wordpress.org/Backing_Up_Your_Database) before installing the plugin.**
+
+1. Unpack archive to this archive to the 'wp-content/plugins/' directory inside
+ of WordPress
+
+ * Maintain the directory structure of the archive (all extracted files
+ should exist in 'wp-content/plugins/disqus-comment-system/'
+
+2. From your blog administration, click on Comments to change settings
+ (WordPress 2.0 users can find the settings under Options > Disqus.)
+
+= More documentation =
+
+Go to [http://disqus.com/help/wordpress](http://disqus.com/help/wordpress)
+
+== Screenshots ==
+
+1. Disqus Comments
+2. Discovery Box (part of Disqus Comments)
+3. Moderation Interface
+
+== Changelog ==
+
+= 2.83 =
+
+* Fix errors when using SSO and rendering javascript inline
+
+= 2.82 =
+
+* Fix PHP errors when there are no comments to sync
+* Adds a new option to render Disqus javascript directly in page markup
+
+= 2.81 =
+
+* Fix for automatic comment syncing
+* Make sure all markup validates for HTML5
+
+= 2.80 =
+
+* Move all scripts to separate files instead of rendering them in php
+* Added a hook to attach custom functions to disqus_config in javascript
+* Fixed exporting bug introduced in 2.78 (Thanks to mkilian)
+* Numerous small compatibility and security enhancements
+
+= 2.79 =
+
+* Reinstate changes removed by 2.78
+
+= 2.78 =
+
+* Security fixes
+* Compatibility for Wordpress version 4.0
+
+= 2.77 =
+
+* Fixes login by email issue
+* Make sure Disqus is enabled after installation
+* Additional security fixes
+
+= 2.76 =
+
+* Security fixes (Thanks to Nik Cubrilovic, Alexander Concha and Marc-Alexandre Montpas)
+* Bump tested Wordpress version to 3.9.1
+* Remove obsolete SSO button uploader
+* Enable 'Output javascript in footer' by default during installation
+* Fix for 'Reset' function not completely working the first time
+
+= 2.75 =
+
+* Bump supported WordPress version to 3.8.
+* Properly encode site name for SSO login button.
+* Increased timeout for comment exporter to 60 seconds.
+* Use https: for admin pages
+* Miscellaneous bug fixes and improvements.
+
+= 2.74 =
+
+* Updated settings UI
+* Add filter hook for setting custom Disqus language
+* For WP >= 3.5, use new media uploader
+* Disable internal Wordpress commenting if Disqus is enabled (thanks Artem Russakovskii)
+* Cleaned up installation and configuration flow
+* Added link to WP backup guide in README
+* Fix admin bar comments link
+* Added a check to avoid a missing key notice when WP_DEBUG=TRUE (thanks Jason Lengstorf)
+* Prevent 404 errors for embed.js from being reported by Google Webmaster Tools (missed in 2.73 README)
+
+= 2.73 =
+
+* Apply CDATA patch from Wordpress 3.4 to dsq_export_wxr_cdata() (thanks Artem
+ Russakovskii for the patch).
+* Added Single Sign-On log-in button and icon to options (only for sites using SSO)
+* Output user website if set in SSO payload
+* Added plugin activation statuses to debug info
+* Bump supported WordPress version to 3.4.1
+* Fixed issue where disqus_dupecheck won't properly uninstall
+* Load second count.js (output-in-footer version) reference via SSL too
+* Added screenshots
+
+= 2.72 =
+
+* Load count.js via SSL when page is accessed via HTTPS
+* Fixed styling issue with Disqus admin.
+
+= 2.71 =
+
+* Fixed issue where embed wasn't using SSL if page was loaded via HTTPS
+* Fixed issue with syncing where to user's without a display_name would
+ revert back to Anonymous (really this time).
+* Fixed issue where Google Webmaster Tools would incorrectly report 404s.
+* Fixed issue with Disqus admin display issues.
+
+= 2.70 =
+
+* Properly uninstall disqus_dupecheck index when uninstalling plugin.
+* Fixed issue with syncing where to user's without a display_name would
+ revert back to Anonymous.
+* Fixed issue where IP addresses weren't being synced properly.
+* Allow non-Administrators (e.g., editors) to see Disqus Moderate panel
+ inline (fixes GH-3)
+
+= 2.69 =
+
+* Bumped version number.
+
+= 2.68 =
+
+* Removed debugging information from web requests in CLI scripts (thanks
+ Ryan Dewhurst for the report).
+* Reduced sync lock time to 1 hour.
+* Fixed an issue which was not allowing pending posts (for sync) to clear.
+* Fixed an issue with CLI scripts when used with certain caching plugins.
+
+= 2.67 =
+
+* Bumped synchronization timer delays to 5 minutes.
+* wp-cli.php now requires php_sapi_name to be set to 'cli' for execution.
+* Fixed a bug with imported comments not storing the correct relative date.
+* Added a lock for dsq_sync_forum, which can be overriden in the command line script
+ with the --force tag.
+* dsq_sync_forum will now handle all pending post metadata updates (formerly a separate
+ cron task, dsq_sync_post).
+
+= 2.66 =
+
+* Fixed issue with jQuery usage which conflicted with updated jQuery version.
+
+= 2.65 =
+
+* Corrected a bug that was causing posts to not appear due to invalid references.
+
+= 2.64 =
+
+* Added an option to disable Disqus without deactivating the plugin.
+* Added a second check for comment sync to prevent stampede race conditions in WP cron.
+
+= 2.63 =
+
+* Added command line script to import comments from DISQUS (scripts/import-comments.php).
+* Added command line script to export comments to DISQUS (scripts/export-comments.php).
+* The exporter will now only do one post at a time.
+* The exporter now only sends required attributes to DISQUS.
+* Moved media into its own directory.
+
+= 2.62 =
+
+* Changed legacy query to use = operator instead of LIKE so it can be indexed.
+
+= 2.61 =
+
+* Fixed an issue which was causing invalid information to be presented in RSS feeds.
+
+= 2.60 =
+
+* Added support for new Single Sign-On (API version 3.0).
+* Improved support for legacy Single Sign-On.
+
+= 2.55 =
+
+* Added support for get_comments_number in templates.
+
+= 2.54 =
+
+* Updated URL to forum moderation.
+
+= 2.53 =
+
+* Fixed an issue with fsockopen and GET requests (only affects certain users).
+
+= 2.52 =
+
+* Fixed issue with Disqus-API package not getting updated (only affecting PHP4).
+
+= 2.51 =
+
+* Added CDATA comments for JavaScript.
+* Syncing comments will now restore missing thread information from old imports.
+* Install and uninstall processes have been improved.
+* Fixed an issue in PHP4 with importing comments.
+* Fixed an issue that could cause duplicate comments in some places.
+* Added an option to remove existing imported comments when importing.
+
+= 2.50 =
+
+* Added missing file.
+
+= 2.49 =
+
+* Database usage has been optimized for storing comment meta data.
+
+You can perform this migration automatically by visiting Comments -> Disqus, or if
+you have a large database, you may do this by hand:
+
+CREATE INDEX disqus_dupecheck ON `wp_commentmeta` (meta_key, meta_value(11));
+INSERT INTO `wp_options` (blog_id, option_name, option_value, autoload) VALUES (0, 'disqus_version', '2.49', 'yes') ON DUPLICATE KEY UPDATE option_value = VALUES(option_value);
+
+= 2.48 =
+
+* Comment synchronization has been optimized to be a single call per-site.
+* disqus.css will now only load when displaying comments
+
+= 2.47 =
+
+* Fixed a security hole with comment importing.
+* Reverted ability to use default template comments design.
+* Comments will now store which version they were imported under.
+* Added an option to disable server side rendering.
+
+= 2.46 =
+
+* Better debugging information for export errors.
+* Added the ability to manual import Disqus comments into Wordpress.
+* Added thread_identifier support to exports.
+* Cleaned up API error messages.
+* Fixed a bug which was causing the import process to not grab only the latest set of comments.
+* Added an option to disable automated synchronization with Disqus.
+
+= 2.45 =
+
+* Comments should now store thread information as well as certain other meta data.
+* Optimize get_thread polling to only pull comments which aren't stored properly.
+
+= 2.44 =
+
+* Fixed JavaScript response for comments sync call.
+* Comments are now marked as closed while showing the embed (fixes showing default respond form).
+
+= 2.43 =
+
+* Fixed a JavaScript syntax error which would cause linting to fail.
+* Correct an issue that was causing comments.php to throw a syntax error under some configurations.
+
+= 2.42 =
+
+* Correct a bug with saving disqus_user_api_key (non-critical).
+* Added settings to Debug Information.
+* Adjusting all includes to use absolute paths.
+* Adjusted JSON usage to solve a problem for some clients.
+
+= 2.41 =
+
+* Correct a bug with double urlencoding titles.
+
+= 2.40 =
+
+* Comments are now synced with Disqus as a delayed asynchronous cron event.
+* Comment count code has been updated to use the new widget. (Comment counts
+ must be linked to get tracked within "the loop" now).
+* API bindings have been migrated to the generic 1.1 Disqus API.
+* Pages will now properly update their permalink with Disqus when it changes. This is
+ done within the sync event above.
+* There is now a Debug Information pane under Advanced to assist with support requests.
+* When Disqus is unreachable it will fallback to the theme's built-in comment display.
+* Legacy mode is no longer available.
+* The plugin management interface can now be localized.
+* The plugin is now valid HTML5.
+
+== Support ==
+
+* Visit http://disqus.com/help/wordpress for help documentation.
+
+* Visit http://help.disqus.com for help from our support team.
diff --git a/wp-content/plugins/disqus-comment-system/screenshot-1.png b/wp-content/plugins/disqus-comment-system/screenshot-1.png
deleted file mode 100644
index 47c8e23..0000000
Binary files a/wp-content/plugins/disqus-comment-system/screenshot-1.png and /dev/null differ
diff --git a/wp-content/plugins/disqus-comment-system/screenshot-2.png b/wp-content/plugins/disqus-comment-system/screenshot-2.png
deleted file mode 100644
index b41e398..0000000
Binary files a/wp-content/plugins/disqus-comment-system/screenshot-2.png and /dev/null differ
diff --git a/wp-content/plugins/disqus-comment-system/screenshot-3.png b/wp-content/plugins/disqus-comment-system/screenshot-3.png
deleted file mode 100644
index 0dead38..0000000
Binary files a/wp-content/plugins/disqus-comment-system/screenshot-3.png and /dev/null differ
diff --git a/wp-content/plugins/disqus-comment-system/scripts/export-comments.php b/wp-content/plugins/disqus-comment-system/scripts/export-comments.php
index 175acd5..cec4f2f 100644
--- a/wp-content/plugins/disqus-comment-system/scripts/export-comments.php
+++ b/wp-content/plugins/disqus-comment-system/scripts/export-comments.php
@@ -1,106 +1,106 @@
-#!/usr/bin/php
-get_var($wpdb->prepare("
- SELECT MAX(ID)
- FROM $wpdb->posts
- WHERE post_type != 'revision'
- AND post_status = 'publish'
- AND comment_count > 0
- AND ID > %d
-", $post_id));
-
-print_line('Max post id is %d', $max_post_id);
-
-while ($post_id < $max_post_id) {
- $start = microtime();
-
- $post = $wpdb->get_results($wpdb->prepare("
- SELECT *
- FROM $wpdb->posts
- WHERE post_type != 'revision'
- AND post_status = 'publish'
- AND comment_count > 0
- AND ID > %d
- ORDER BY ID ASC
- LIMIT 1
- ", $post_id));
- $post = $post[0];
- $post_id = $post->ID;
-
- print_line(' Exporting comments for post id %d', $post_id);
-
- $response = null;
- $query = $wpdb->get_results( $wpdb->prepare("SELECT COUNT(*) as total FROM $wpdb->comments WHERE comment_post_ID = %d AND comment_agent NOT LIKE 'Disqus/%%' LIMIT ".EXPORT_CHUNK_SIZE, $post_id) );
- $total_comments = $query[0]->total;
-
- $comments = $wpdb->get_results( $wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d AND comment_agent NOT LIKE 'Disqus/%%' LIMIT ".EXPORT_CHUNK_SIZE, $post_id) );
- $group_id = null;
- $at = 0;
-
- // we need to send empty files to ensure EOF happens
- while (($at === 0 && $post_id == $max_post_id) || $at < $total_comments) {
- if ($post_id == $max_post_id && ($at + EXPORT_CHUNK_SIZE) >= $total_comments) {
- $eof = 1;
- }
- $wxr = dsq_export_wp($post, $comments);
- $response = $dsq_api->import_wordpress_comments($wxr, $timestamp, $eof);
- if (!($response['group_id'] > 0)) {
- print_line('---------------------------------------------------------');
- print_line('There was an error communicating with DISQUS!');
- print_line($dsq_api->get_last_error());
- print_line('---------------------------------------------------------');
- }
- $group_id = $response['group_id'];
- print_line(' %d comments exported', count($comments), $time);
- $total_exported += count($comments);
- $at += EXPORT_CHUNK_SIZE;
- $comments = $wpdb->get_results( $wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d AND comment_agent NOT LIKE 'Disqus/%%' LIMIT ".EXPORT_CHUNK_SIZE." OFFSET {$at}", $post->ID) );
- // assuming the cache is the internal, reset it's value to empty to avoid
- // large memory consumption
- $wp_object_cache->cache = array();
- }
-
- $time = abs(microtime() - $start);
- print_line(' Done! (took %.2fs)', $time);
-}
-$total_time = abs(microtime() - $global_start);
-print_line('---------------------------------------------------------');
-print_line('Done (processing took %.2fs)! %d comments were sent to DISQUS', $total_time, $total_exported);
-if ($group_id) {
- print_line('');
- print_line('Status available at http://import.disqus.com/group/%d/', $group_id);
-}
-print_line('---------------------------------------------------------');
+#!/usr/bin/php
+get_var($wpdb->prepare("
+ SELECT MAX(ID)
+ FROM $wpdb->posts
+ WHERE post_type != 'revision'
+ AND post_status = 'publish'
+ AND comment_count > 0
+ AND ID > %d
+", $post_id));
+
+print_line('Max post id is %d', $max_post_id);
+
+while ($post_id < $max_post_id) {
+ $start = microtime();
+
+ $post = $wpdb->get_results($wpdb->prepare("
+ SELECT *
+ FROM $wpdb->posts
+ WHERE post_type != 'revision'
+ AND post_status = 'publish'
+ AND comment_count > 0
+ AND ID > %d
+ ORDER BY ID ASC
+ LIMIT 1
+ ", $post_id));
+ $post = $post[0];
+ $post_id = $post->ID;
+
+ print_line(' Exporting comments for post id %d', $post_id);
+
+ $response = null;
+ $query = $wpdb->get_results( $wpdb->prepare("SELECT COUNT(*) as total FROM $wpdb->comments WHERE comment_post_ID = %d AND comment_agent NOT LIKE 'Disqus/%%' LIMIT ".EXPORT_CHUNK_SIZE, $post_id) );
+ $total_comments = $query[0]->total;
+
+ $comments = $wpdb->get_results( $wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d AND comment_agent NOT LIKE 'Disqus/%%' LIMIT ".EXPORT_CHUNK_SIZE, $post_id) );
+ $group_id = null;
+ $at = 0;
+
+ // we need to send empty files to ensure EOF happens
+ while (($at === 0 && $post_id == $max_post_id) || $at < $total_comments) {
+ if ($post_id == $max_post_id && ($at + EXPORT_CHUNK_SIZE) >= $total_comments) {
+ $eof = 1;
+ }
+ $wxr = dsq_export_wp($post, $comments);
+ $response = $dsq_api->import_wordpress_comments($wxr, $timestamp, $eof);
+ if (!($response['group_id'] > 0)) {
+ print_line('---------------------------------------------------------');
+ print_line('There was an error communicating with DISQUS!');
+ print_line($dsq_api->get_last_error());
+ print_line('---------------------------------------------------------');
+ }
+ $group_id = $response['group_id'];
+ print_line(' %d comments exported', count($comments), $time);
+ $total_exported += count($comments);
+ $at += EXPORT_CHUNK_SIZE;
+ $comments = $wpdb->get_results( $wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d AND comment_agent NOT LIKE 'Disqus/%%' LIMIT ".EXPORT_CHUNK_SIZE." OFFSET {$at}", $post->ID) );
+ // assuming the cache is the internal, reset it's value to empty to avoid
+ // large memory consumption
+ $wp_object_cache->cache = array();
+ }
+
+ $time = abs(microtime() - $start);
+ print_line(' Done! (took %.2fs)', $time);
+}
+$total_time = abs(microtime() - $global_start);
+print_line('---------------------------------------------------------');
+print_line('Done (processing took %.2fs)! %d comments were sent to DISQUS', $total_time, $total_exported);
+if ($group_id) {
+ print_line('');
+ print_line('Status available at http://import.disqus.com/group/%d/', $group_id);
+}
+print_line('---------------------------------------------------------');
?>
\ No newline at end of file
diff --git a/wp-content/plugins/disqus-comment-system/scripts/import-comments.php b/wp-content/plugins/disqus-comment-system/scripts/import-comments.php
index 58eca78..6be7541 100644
--- a/wp-content/plugins/disqus-comment-system/scripts/import-comments.php
+++ b/wp-content/plugins/disqus-comment-system/scripts/import-comments.php
@@ -1,63 +1,63 @@
-#!/usr/bin/php
-get_last_error());
- print_line('---------------------------------------------------------');
- die();
- break;
- } else {
- list($imported, $last_comment_id) = $result;
- }
- $total += $imported;
- $time = abs(microtime() - $start);
-
- // assuming the cache is the internal, reset it's value to empty to avoid
- // large memory consump
- $wp_object_cache->cache = array();
-
- $new_memory_usage = memory_get_peak_usage();
- print_line(' %d comments imported (took %.2fs, memory increased by %db)', $imported, $time, ($new_memory_usage - $memory_usage));
- $memory_usage = $new_memory_usage;
-}
-$total_time = abs(microtime() - $global_start);
-print_line('---------------------------------------------------------');
-print_line('Done (took %.2fs)! %d comments imported from DISQUS', $total_time, $total);
-print_line('---------------------------------------------------------');
+#!/usr/bin/php
+get_last_error());
+ print_line('---------------------------------------------------------');
+ die();
+ break;
+ } else {
+ list($imported, $last_comment_id) = $result;
+ }
+ $total += $imported;
+ $time = abs(microtime() - $start);
+
+ // assuming the cache is the internal, reset it's value to empty to avoid
+ // large memory consump
+ $wp_object_cache->cache = array();
+
+ $new_memory_usage = memory_get_peak_usage();
+ print_line(' %d comments imported (took %.2fs, memory increased by %db)', $imported, $time, ($new_memory_usage - $memory_usage));
+ $memory_usage = $new_memory_usage;
+}
+$total_time = abs(microtime() - $global_start);
+print_line('---------------------------------------------------------');
+print_line('Done (took %.2fs)! %d comments imported from DISQUS', $total_time, $total);
+print_line('---------------------------------------------------------');
?>
\ No newline at end of file
diff --git a/wp-content/plugins/disqus-comment-system/upgrade.php b/wp-content/plugins/disqus-comment-system/upgrade.php
index b062639..f61a27d 100644
--- a/wp-content/plugins/disqus-comment-system/upgrade.php
+++ b/wp-content/plugins/disqus-comment-system/upgrade.php
@@ -1,21 +1,21 @@
-
-
-
-
+
+
+
+
\ No newline at end of file
diff --git a/wp-content/plugins/disqus-comment-system/xd_receiver.htm b/wp-content/plugins/disqus-comment-system/xd_receiver.htm
deleted file mode 100644
index 72edcbc..0000000
--- a/wp-content/plugins/disqus-comment-system/xd_receiver.htm
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/wp-content/plugins/google-calendar-events/license.txt b/wp-content/plugins/google-calendar-events/LICENSE.txt
similarity index 98%
rename from wp-content/plugins/google-calendar-events/license.txt
rename to wp-content/plugins/google-calendar-events/LICENSE.txt
index 0a98ec0..ecbc059 100644
--- a/wp-content/plugins/google-calendar-events/license.txt
+++ b/wp-content/plugins/google-calendar-events/LICENSE.txt
@@ -1,339 +1,339 @@
- 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.
-
- 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
-convey the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
-
- Copyright (C)
-
- 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 2 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, write to the Free Software Foundation, Inc.,
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-
-Also add information on how to contact you by electronic and paper mail.
-
-If the program is interactive, make it output a short notice like this
-when it starts in an interactive mode:
-
- Gnomovision version 69, Copyright (C) year name of author
- Gnomovision 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, the commands you use may
-be called something other than `show w' and `show c'; they could even be
-mouse-clicks or menu items--whatever suits your program.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the program, if
-necessary. Here is a sample; alter the names:
-
- Yoyodyne, Inc., hereby disclaims all copyright interest in the program
- `Gnomovision' (which makes passes at compilers) written by James Hacker.
-
- , 1 April 1989
- Ty Coon, President of Vice
-
-This 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
+ 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.
+
+ 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
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+
+ Copyright (C)
+
+ 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 2 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, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) year name of author
+ Gnomovision 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, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+ , 1 April 1989
+ Ty Coon, President of Vice
+
+This 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.
\ No newline at end of file
diff --git a/wp-content/plugins/google-calendar-events/readme.txt b/wp-content/plugins/google-calendar-events/README.txt
similarity index 88%
rename from wp-content/plugins/google-calendar-events/readme.txt
rename to wp-content/plugins/google-calendar-events/README.txt
index a01dccf..b8e2b31 100644
--- a/wp-content/plugins/google-calendar-events/readme.txt
+++ b/wp-content/plugins/google-calendar-events/README.txt
@@ -1,284 +1,322 @@
-=== Google Calendar Events ===
-Contributors: pderksen, nickyoung87, rosshanney
-Tags: google calendar, google, calendar, events, gcal
-Requires at least: 3.7.4
-Tested up to: 4.0
-Stable tag: trunk
-License: GPLv2 or later
-License URI: http://www.gnu.org/licenses/gpl-2.0.html
-
-Parses Google Calendar feeds and displays the events as a calendar grid or list on a page, post or widget.
-
-== Description ==
-
-Parses Google Calendar feeds and displays the events as a calendar grid or list on a page, post or widget.
-
-= Features =
-
-* Parses Google Calendar feeds to extract events.
-* Displays events as a list or within a calendar grid.
-* Events from multiple Google Calendar feeds can be shown in a single list / grid.
-* Lists and grids can be displayed in posts, pages or within a widget.
-* Options to change the number of events retrieved, date / time format, cache duration, etc.
-* Complete customisation of the event information displayed.
-* Calendar grids can have the ability to change the month displayed.
-
-[Plugin Documentation & Getting Started](http://wpdocs.philderksen.com/google-calendar-events/?utm_source=wordpress_org&utm_medium=link&utm_campaign=gce_lite)
-
-###Feature Requests and Updates###
-
-* [Public roadmap/feature requests](https://trello.com/b/ZQSzsarY)
-* [Get notified when new features are released](http://eepurl.com/0_VsT)
-* [Follow this project on Github](https://github.com/pderksen/WP-Google-Calendar-Events)
-
-This plugin was originally created by [Ross Hanney](http://www.rhanney.co.uk), a web developer based in the UK specialising in WordPress and PHP.
-
-## Available Translations ##
-
-* Spanish - Provided by Eduardo Larequi of [educacion.navarra.es/web/pnte/](http://www.educacion.navarra.es/web/pnte/).
-* Italian - Provided by Francesco Paccagnella of [pacca.it](http://www.pacca.it/).
-* French - Provided by Vincent Bray.
-* German - Provided by Stefanie Drucker of [kreativhuhn.at](http://www.kreativhuhn.at/).
-* Norwegian - Provided by Tore Hjartland of [aliom.no](http://www.aliom.no/).
-
-== Installation ==
-
-There are three ways to install this plugin.
-
-= 1. Admin Search =
-1. In your Admin, go to menu Plugins > Add.
-1. Search for `Google Calendar`.
-1. Find the plugin that's labeled `Google Calendar Events`.
-1. Look for the author name `Phil Derksen` on the plugin.
-1. Click to install.
-1. Activate the plugin.
-1. A new menu item `GCal Events` will appear in the main menu.
-
-= 2. Download & Upload =
-1. Download the plugin (a zip file) on the right column of this page.
-1. In your Admin, go to menu Plugins > Add.
-1. Select the tab "Upload".
-1. Upload the .zip file you just downloaded.
-1. Activate the plugin.
-1. A new menu item `GCal Events` will appear in the main menu.
-
-= 3. FTP Upload =
-1. Download the plugin (.zip file) on the right column of this page.
-1. Unzip the zip file contents.
-1. Upload the `google-calendar-events` folder to the `/wp-content/plugins/` directory of your site.
-1. Activate the plugin through the 'Plugins' menu in WordPress.
-1. A new menu item `GCal Events` will appear in the main menu.
-
-== Frequently Asked Questions ==
-
-[Plugin Documentation & Getting Started](http://wpdocs.philderksen.com/google-calendar-events/?utm_source=wordpress_org&utm_medium=link&utm_campaign=gce_lite)
-
-== Screenshots ==
-
-1. Grid display in full page with tooltip
-1. Grid display in widget
-1. List display in widget
-1. Simple display options
-1. Calendar feed settings
-1. Calendar widget settings
-1. Event display builder editor
-
-== Changelog ==
-
-= 2.0.6 =
-
-* Added minimum and maximum feed date options to fix event display issues and boost performance.
-* Fixed a caching issue to increase performance.
-* Fixed bug where backslashes kept getting added to event titles that already contained single quotes when navigating through pages in widget.
-
-= 2.0.5.1 =
-
-* Fix timezone issue.
-
-= 2.0.5 =
-
-* Fixed display bug with event date and grouped lists.
-* Fixed broken paging links when feed IDs contain spaces between them.
-* Fixed bug with start offset and grouped lists not working properly.
-* Fixed bug where clear cache link was showing on any type of CPT.
-* Added German translation - Provided by Stefanie Drucker of [kreativhuhn.at](http://www.kreativhuhn.at/).
-* Added Norwegian translation - Provided by Tore Hjartland of [aliom.no](http://www.aliom.no/).
-
-= 2.0.4 =
-
-* Added option to show/hide paging.
-* Added option to limit display to any number of days or events per page.
-* Added option to set the start date offset any number of days back or ahead (list view).
-* Removed retrieve events from/until options now that display limit options will be used.
-* Removed max number of events to retrieve option.
-* Added shortcode attribute 'paging'.
-* Added shortcode attribute 'interval'.
-* Added shortcode attribute 'interval_count'.
-* Added shortcode attribute 'offset_interval_count'.
-* Added shortcode attribute 'offset_direction'.
-* Updated shortcode 'display' attribute to allow a value of 'grouped-list'.
-* Date no longer shows up for the title (list view).
-* HTML restructured to use div tags instead of an unordered list (list view).
-* Nav bar HTML (Back/Next links and month title) restructured to use div tags instead of span and percentages.
-* Moved clear cache button and changed style.
-* Added Italian translation - Provided by Francesco Paccagnella of [pacca.it](http://www.pacca.it/).
-* Added French translation - Provided by Vincent Bray.
-* Fixed PHP error during upgrade.
-* Fixed cross-site scripting (XSS) vulnerability.
-* JavaScript restructured to fit more in line with best practices.
-* Remove unused admin script file.
-
-= 2.0.3.1 =
-
-* Fixed bug where retrieve from/until dates were accidentally removed.
-
-= 2.0.3 =
-
-* Fixed bug where calendar feed caches weren't getting cleared properly.
-* Fixed feed settings metabox content wrapping issue.
-
-= 2.0.2 =
-
-* Added Spanish translation - Provided by Eduardo Larequi of [educacion.navarra.es/web/pnte/](http://www.educacion.navarra.es/web/pnte/).
-* Fixed timezone issues by forcing calendar feeds to use the timezone selected in the site's General Settings. Feed-specific timezone setting removed.
-* Fixed a bug with recurring events display.
-* Fixed an upgrade bug with multiple day events.
-
-= 2.0.1 =
-
-* Fixed display errors with certain event builder shortcodes.
-* Added language folder.
-
-= 2.0.0 =
-
-* Plugin rewritten from scratch.
-* Now using custom post types for storing and customizing Google calendar feeds.
-* Introduced the shortcode `[gcal]` (old shortcode still supported).
-
-= 0.7.3.1 =
-
-* Include missing file: upgrade-notice.php.
-
-= 0.7.3 =
-
-* Added warning about upcoming version 2.0 release.
-* Added option to save settings upon uninstall.
-* Tested with WordPress 4.0.
-
-= 0.7.2 =
-
-* Fixed a bug causing the "More details" Google Calendar information to be displayed in the wrong timezone
-* Fixed a bug that prevented setting the cache duration to 0 from working correctly
-* Fixed an issue that prevented Ajax from working with FORCE_SSL_ADMIN enabled
-* Now uses [wp_enqueue_scripts](http://wpdevel.wordpress.com/2011/12/12/use-wp_enqueue_scripts-not-wp_print_styles-to-enqueue-scripts-and-styles-for-the-frontend/)
-
-= 0.7.1 =
-
-* Fixed bug causing AJAX enabled calendar grids to not function correctly
-* Fixed bug causing all-day events from outside required date range to be displayed
-* Fixed bug causing tooltip date title heading setting to be ignored
-* Added further data sanitisation on output
-* Feeds with no events will now be cached to prevent HTTP requests on every page load
-
-= 0.7 =
-
-* Fixed bug causing event dates / times to be displayed in the wrong timezone
-* Changed the [link-path] Event Display Builder shortcode to [url]
-* Fixed an Opera specific CSS issue causing page lists to be hidden
-* Lists can now be displayed in descending or ascending order
-* Added [event-id] and [cal-id] Event Display Builder shortcodes
-* Added an offset parameter for date / time based Event Display Builder shortcodes
-* Added an autolink parameter for enabling / disabling automatic linking of URLs
-* Added gce-day-past or gce-day-future classes to calendar grid cells
-* Cleaned up CSS
-
-= 0.6 =
-
-* Drastically reduced memory usage
-* Improved feed data caching system
-* Improved error reporting
-* General performance and efficiency improvements
-* Added a few more shortcodes to the event display builder
-* Other [miscellaneous changes / additions and bug fixes](http://www.rhanney.co.uk/2011/04/29/google-calendar-events-0-6)
-
-= 0.5 =
-
-* Added [event display builder](http://www.rhanney.co.uk/plugins/google-calendar-events/event-display-builder) feature, which vastly improves the customization possibilities of the plugin. This feature encompasses many of the most requested features, such as:
- - All-day events can be handled differently than 'normal' events
- - Start and end times / dates can be displayed on the same line (as can any other event information)
- - HTML (and Markdown) entered in Google Calendar fields can be properly parsed
-* Start and end times for retrieval of events are now much more flexible
-* A custom error message for non-admin users can now be specified
-* No longer loads SimplePie when it is not required
-
-= 0.4.1 =
-
-* Fix / workaround for the long-running timezone bug. Please take a look at [this](http://www.rhanney.co.uk/2011/01/16/google-calendar-events-0-4-1) for more information.
-* Added additional 'Maximum no. events to display' option to widget / shortcode (mainly to address a further issue caused by the above fix)
-* i18n related bug fix
-* Added support for widget_title filter (courtesy of [James](http://lunasea-studios.com))
-* Added Hungarian (hu_HU) translation ([danieltakacs](http://ek.klog.hu))
-* Now using minified version of jQuery qTip script
-
-= 0.4 =
-
-* More control over how start and end dates / times are displayed
-* Events can now be limited to a specified timeframe (number of days)
-* Events on the same day in lists can now be shown under a single date title
-* JavaScript can now be added to the footer rather than the header, via an option
-* The 'Loading...' text can now be customized
-* Description text can now be limited to a specified number of words
-* Multi-day events can be shown on each day that they span ([sort of](http://www.rhanney.co.uk/2010/08/19/google-calendar-events-0-4#multiday))
-* Bug fixes
-* i18n / l10n fixes
-
-= 0.3.1 =
-
-* l10n / i18n fixes. Dates should now be localized correctly and should maintain localization after an AJAX request
-* MU / Multi-site issues. Issues preventing adding of feeds have been addressed
-
-= 0.3 =
-
-* Now allows events from multiple Google Calendar feeds to be displayed on a single calendar grid / list
-* Internationalization support added
-
-= 0.2.1 =
-
-* Added option to allow 'More details' links to open in new window / tab.
-* Added option to choose a specific timezone for each feed
-* Line breaks in an event description will now be preserved
-* Fixed a bug casing the title to not be displayed on lists
-* Other minor bug fixes
-
-= 0.2 =
-
-* Added customization options for how information is displayed.
-* Can now display: start time, end time and date, location, description and event link.
-* Tooltips now using qTip jQuery plugin.
-
-= 0.1.4 =
-
-* More bug fixes.
-
-= 0.1.3 =
-
-* Several bug fixes, including fixing JavaScript problems that prevented tooltips appearing.
-
-= 0.1.2 =
-
-* Bug fixes.
-
-= 0.1.1 =
-
-* Fix to prevent conflicts with other plugins.
-* Changes to readme.txt.
-
-= 0.1 =
-
-* Initial release.
-
-== Upgrade Notice ==
-
-= 2.0.0 =
-
-This is a major upgrade to a new code base and structure. PLEASE make sure you backup your site before upgrading.
+=== Google Calendar Events ===
+Contributors: pderksen, nickyoung87, rosshanney
+Tags: google calendar, google, calendar, events, gcal
+Requires at least: 3.7.4
+Tested up to: 4.0
+Stable tag: trunk
+License: GPLv2 or later
+License URI: http://www.gnu.org/licenses/gpl-2.0.html
+
+Parses Google Calendar feeds and displays the events as a calendar grid or list on a page, post or widget.
+
+== Description ==
+
+Parses Google Calendar feeds and displays the events as a calendar grid or list on a page, post or widget.
+
+= Features =
+
+* Parses Google Calendar feeds to extract events.
+* Displays events as a list or within a calendar grid.
+* Events from multiple Google Calendar feeds can be shown in a single list / grid.
+* Lists and grids can be displayed in posts, pages or within a widget.
+* Options to change the number of events retrieved, date / time format, cache duration, etc.
+* Complete customisation of the event information displayed.
+* Calendar grids can have the ability to change the month displayed.
+
+[Plugin Documentation & Getting Started](http://wpdocs.philderksen.com/google-calendar-events/?utm_source=wordpress_org&utm_medium=link&utm_campaign=gce_lite)
+
+###Feature Requests and Updates###
+
+* [Public roadmap/feature requests](https://trello.com/b/ZQSzsarY)
+* [Get notified when new features are released](http://eepurl.com/0_VsT)
+* [Follow this project on Github](https://github.com/pderksen/WP-Google-Calendar-Events)
+
+This plugin was originally created by [Ross Hanney](http://www.rhanney.co.uk), a web developer based in the UK specialising in WordPress and PHP.
+
+## Available Translations ##
+
+* Spanish - Provided by Eduardo Larequi of [educacion.navarra.es/web/pnte/](http://www.educacion.navarra.es/web/pnte/).
+* Italian - Provided by Francesco Paccagnella of [pacca.it](http://www.pacca.it/).
+* French - Provided by Vincent Bray.
+* German - Provided by Stefanie Drucker of [kreativhuhn.at](http://www.kreativhuhn.at/).
+* Norwegian - Provided by Tore Hjartland of [aliom.no](http://www.aliom.no/).
+* Polish - Provided by Michał Pasternak of [iplweb.pl](http://iplweb.pl/).
+* Lithuanian - Provided by Andrius Mazeika of [mazeika.info](http://mazeika.info/).
+
+== Installation ==
+
+There are three ways to install this plugin.
+
+= 1. Admin Search =
+1. In your Admin, go to menu Plugins > Add.
+1. Search for `Google Calendar`.
+1. Find the plugin that's labeled `Google Calendar Events`.
+1. Look for the author name `Phil Derksen` on the plugin.
+1. Click to install.
+1. Activate the plugin.
+1. A new menu item `GCal Events` will appear in the main menu.
+
+= 2. Download & Upload =
+1. Download the plugin (a zip file) on the right column of this page.
+1. In your Admin, go to menu Plugins > Add.
+1. Select the tab "Upload".
+1. Upload the .zip file you just downloaded.
+1. Activate the plugin.
+1. A new menu item `GCal Events` will appear in the main menu.
+
+= 3. FTP Upload =
+1. Download the plugin (.zip file) on the right column of this page.
+1. Unzip the zip file contents.
+1. Upload the `google-calendar-events` folder to the `/wp-content/plugins/` directory of your site.
+1. Activate the plugin through the 'Plugins' menu in WordPress.
+1. A new menu item `GCal Events` will appear in the main menu.
+
+== Frequently Asked Questions ==
+
+[Plugin Documentation & Getting Started](http://wpdocs.philderksen.com/google-calendar-events/?utm_source=wordpress_org&utm_medium=link&utm_campaign=gce_lite)
+
+== Screenshots ==
+
+1. Grid display in full page with tooltip
+1. Grid display in widget
+1. List display in widget
+1. Simple display options
+1. Calendar feed settings
+1. Calendar widget settings
+1. Event display builder editor
+
+== Changelog ==
+
+= 2.1.1 =
+
+* Fixed bug with all day events not displaying.
+* Added missing timezone parameter to internal query.
+
+= 2.1.0 =
+
+* Updated to use Google Calendar API version 3. Version 2 deprecated on Nov. 17, 2014.
+
+= 2.0.7.1 =
+
+* As of Nov. 17, 2014 the GCal API v2 is deprecated, which breaks all calendar feed displays. This update will temporarily hide the display while we work on a solution that uses GCal API v3.
+
+= 2.0.7 =
+
+* Events will now display if it hasn't ended yet for list views.
+* Fixed bug with date() call causing a display error in some cases.
+* Fixed bug with with widget tooltip text display.
+* Added cache clearing on upgrade.
+* Added filters for Previous and Next link text.
+* Internationalization and language file updates.
+* Simplified text domain function.
+* Added Lithuanian translation - Provided by Andrius Mazeika of [mazeika.info](http://mazeika.info/).
+
+= 2.0.6.2 =
+
+* Reverted previous bug fix that introduced new bugs.
+
+= 2.0.6.1 =
+
+* Added Polish translation - Provided by Michał Pasternak of [iplweb.pl](http://iplweb.pl/).
+* Updated Italian translation.
+* Updated French translation.
+* Fixed bug with date() call causing a display error in some cases.
+* Minor bug fixes.
+
+= 2.0.6 =
+
+* Added minimum and maximum feed date options to fix event display issues and boost performance.
+* Fixed a caching issue to increase performance.
+* Fixed bug where backslashes kept getting added to event titles that already contained single quotes when navigating through pages in widget.
+
+= 2.0.5.1 =
+
+* Fix timezone issue.
+
+= 2.0.5 =
+
+* Fixed display bug with event date and grouped lists.
+* Fixed broken paging links when feed IDs contain spaces between them.
+* Fixed bug with start offset and grouped lists not working properly.
+* Fixed bug where clear cache link was showing on any type of CPT.
+* Added German translation - Provided by Stefanie Drucker of [kreativhuhn.at](http://www.kreativhuhn.at/).
+* Added Norwegian translation - Provided by Tore Hjartland of [aliom.no](http://www.aliom.no/).
+
+= 2.0.4 =
+
+* Added option to show/hide paging.
+* Added option to limit display to any number of days or events per page.
+* Added option to set the start date offset any number of days back or ahead (list view).
+* Removed retrieve events from/until options now that display limit options will be used.
+* Removed max number of events to retrieve option.
+* Added shortcode attribute 'paging'.
+* Added shortcode attribute 'interval'.
+* Added shortcode attribute 'interval_count'.
+* Added shortcode attribute 'offset_interval_count'.
+* Added shortcode attribute 'offset_direction'.
+* Updated shortcode 'display' attribute to allow a value of 'grouped-list'.
+* Date no longer shows up for the title (list view).
+* HTML restructured to use div tags instead of an unordered list (list view).
+* Nav bar HTML (Back/Next links and month title) restructured to use div tags instead of span and percentages.
+* Moved clear cache button and changed style.
+* Added Italian translation - Provided by Francesco Paccagnella of [pacca.it](http://www.pacca.it/).
+* Added French translation - Provided by Vincent Bray.
+* Fixed PHP error during upgrade.
+* Fixed cross-site scripting (XSS) vulnerability.
+* JavaScript restructured to fit more in line with best practices.
+* Remove unused admin script file.
+
+= 2.0.3.1 =
+
+* Fixed bug where retrieve from/until dates were accidentally removed.
+
+= 2.0.3 =
+
+* Fixed bug where calendar feed caches weren't getting cleared properly.
+* Fixed feed settings metabox content wrapping issue.
+
+= 2.0.2 =
+
+* Added Spanish translation - Provided by Eduardo Larequi of [educacion.navarra.es/web/pnte/](http://www.educacion.navarra.es/web/pnte/).
+* Fixed timezone issues by forcing calendar feeds to use the timezone selected in the site's General Settings. Feed-specific timezone setting removed.
+* Fixed a bug with recurring events display.
+* Fixed an upgrade bug with multiple day events.
+
+= 2.0.1 =
+
+* Fixed display errors with certain event builder shortcodes.
+* Added language folder.
+
+= 2.0.0 =
+
+* Plugin rewritten from scratch.
+* Now using custom post types for storing and customizing Google calendar feeds.
+* Introduced the shortcode `[gcal]` (old shortcode still supported).
+
+= 0.7.3.1 =
+
+* Include missing file: upgrade-notice.php.
+
+= 0.7.3 =
+
+* Added warning about upcoming version 2.0 release.
+* Added option to save settings upon uninstall.
+* Tested with WordPress 4.0.
+
+= 0.7.2 =
+
+* Fixed a bug causing the "More details" Google Calendar information to be displayed in the wrong timezone
+* Fixed a bug that prevented setting the cache duration to 0 from working correctly
+* Fixed an issue that prevented Ajax from working with FORCE_SSL_ADMIN enabled
+* Now uses [wp_enqueue_scripts](http://wpdevel.wordpress.com/2011/12/12/use-wp_enqueue_scripts-not-wp_print_styles-to-enqueue-scripts-and-styles-for-the-frontend/)
+
+= 0.7.1 =
+
+* Fixed bug causing AJAX enabled calendar grids to not function correctly
+* Fixed bug causing all-day events from outside required date range to be displayed
+* Fixed bug causing tooltip date title heading setting to be ignored
+* Added further data sanitisation on output
+* Feeds with no events will now be cached to prevent HTTP requests on every page load
+
+= 0.7 =
+
+* Fixed bug causing event dates / times to be displayed in the wrong timezone
+* Changed the [link-path] Event Display Builder shortcode to [url]
+* Fixed an Opera specific CSS issue causing page lists to be hidden
+* Lists can now be displayed in descending or ascending order
+* Added [event-id] and [cal-id] Event Display Builder shortcodes
+* Added an offset parameter for date / time based Event Display Builder shortcodes
+* Added an autolink parameter for enabling / disabling automatic linking of URLs
+* Added gce-day-past or gce-day-future classes to calendar grid cells
+* Cleaned up CSS
+
+= 0.6 =
+
+* Drastically reduced memory usage
+* Improved feed data caching system
+* Improved error reporting
+* General performance and efficiency improvements
+* Added a few more shortcodes to the event display builder
+* Other [miscellaneous changes / additions and bug fixes](http://www.rhanney.co.uk/2011/04/29/google-calendar-events-0-6)
+
+= 0.5 =
+
+* Added [event display builder](http://www.rhanney.co.uk/plugins/google-calendar-events/event-display-builder) feature, which vastly improves the customization possibilities of the plugin. This feature encompasses many of the most requested features, such as:
+ - All-day events can be handled differently than 'normal' events
+ - Start and end times / dates can be displayed on the same line (as can any other event information)
+ - HTML (and Markdown) entered in Google Calendar fields can be properly parsed
+* Start and end times for retrieval of events are now much more flexible
+* A custom error message for non-admin users can now be specified
+* No longer loads SimplePie when it is not required
+
+= 0.4.1 =
+
+* Fix / workaround for the long-running timezone bug. Please take a look at [this](http://www.rhanney.co.uk/2011/01/16/google-calendar-events-0-4-1) for more information.
+* Added additional 'Maximum no. events to display' option to widget / shortcode (mainly to address a further issue caused by the above fix)
+* i18n related bug fix
+* Added support for widget_title filter (courtesy of [James](http://lunasea-studios.com))
+* Added Hungarian (hu_HU) translation ([danieltakacs](http://ek.klog.hu))
+* Now using minified version of jQuery qTip script
+
+= 0.4 =
+
+* More control over how start and end dates / times are displayed
+* Events can now be limited to a specified timeframe (number of days)
+* Events on the same day in lists can now be shown under a single date title
+* JavaScript can now be added to the footer rather than the header, via an option
+* The 'Loading...' text can now be customized
+* Description text can now be limited to a specified number of words
+* Multi-day events can be shown on each day that they span ([sort of](http://www.rhanney.co.uk/2010/08/19/google-calendar-events-0-4#multiday))
+* Bug fixes
+* i18n / l10n fixes
+
+= 0.3.1 =
+
+* l10n / i18n fixes. Dates should now be localized correctly and should maintain localization after an AJAX request
+* MU / Multi-site issues. Issues preventing adding of feeds have been addressed
+
+= 0.3 =
+
+* Now allows events from multiple Google Calendar feeds to be displayed on a single calendar grid / list
+* Internationalization support added
+
+= 0.2.1 =
+
+* Added option to allow 'More details' links to open in new window / tab.
+* Added option to choose a specific timezone for each feed
+* Line breaks in an event description will now be preserved
+* Fixed a bug casing the title to not be displayed on lists
+* Other minor bug fixes
+
+= 0.2 =
+
+* Added customization options for how information is displayed.
+* Can now display: start time, end time and date, location, description and event link.
+* Tooltips now using qTip jQuery plugin.
+
+= 0.1.4 =
+
+* More bug fixes.
+
+= 0.1.3 =
+
+* Several bug fixes, including fixing JavaScript problems that prevented tooltips appearing.
+
+= 0.1.2 =
+
+* Bug fixes.
+
+= 0.1.1 =
+
+* Fix to prevent conflicts with other plugins.
+* Changes to readme.txt.
+
+= 0.1 =
+
+* Initial release.
+
+== Upgrade Notice ==
+
+= 2.1.0 =
+
+Updated to use Google Calendar API version 3. Version 2 deprecated on Nov. 17, 2014.
diff --git a/wp-content/plugins/google-calendar-events/class-google-calendar-events-admin.php b/wp-content/plugins/google-calendar-events/class-google-calendar-events-admin.php
index fd2f927..f828173 100644
--- a/wp-content/plugins/google-calendar-events/class-google-calendar-events-admin.php
+++ b/wp-content/plugins/google-calendar-events/class-google-calendar-events-admin.php
@@ -55,6 +55,70 @@ class Google_Calendar_Events_Admin {
// Add the options page and menu item.
add_action( 'admin_menu', array( $this, 'add_plugin_admin_menu' ), 2 );
+
+ // Add admin notice for users upgrading from before 2.1.0.
+ if( version_compare( $this->version, '2.1.0', '<' ) ) {
+ add_action( 'admin_notices', array( $this, 'show_admin_notice' ) );
+ }
+
+ // Add admin notice after plugin activation. Also check if should be hidden.
+ add_action( 'admin_notices', array( $this, 'admin_api_settings_notice' ) );
+ }
+
+ /**
+ * Show notice after plugin install/activate
+ * Also check if user chooses to hide it.
+ *
+ * @since 2.1.0
+ */
+ public function admin_api_settings_notice() {
+ // Exit all of this is stored value is false/0 or not set.
+ if ( false == get_option( 'gce_show_admin_install_notice' ) ) {
+ return;
+ }
+
+ $screen = get_current_screen();
+
+ // Delete stored value if "hide" button click detected (custom querystring value set to 1).
+ if ( ! empty( $_REQUEST['gce-dismiss-install-nag'] ) || in_array( $screen->id, $this->plugin_screen_hook_suffix ) ) {
+ delete_option( 'gce_show_admin_install_notice' );
+ return;
+ }
+
+ // At this point show install notice. Show it only on the plugin screen.
+ if( get_current_screen()->id == 'plugins' || $this->viewing_this_plugin() ) {
+ include_once( 'views/admin/api-settings-notice.php' );
+ }
+ }
+
+ /**
+ * Check if viewing one of this plugin's admin pages.
+ *
+ * @since 2.1.0
+ *
+ * @return bool
+ */
+ private function viewing_this_plugin() {
+ if ( ! isset( $this->plugin_screen_hook_suffix ) ) {
+ return false;
+ }
+
+ $screen = get_current_screen();
+
+ if ( $screen->id == 'edit-gce_feed' || $screen->id == 'gce_feed' ) {
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ /**
+ * Fired when the plugin is activated.
+ *
+ * @since 2.1.0
+ */
+ public static function activate() {
+ update_option( 'gce_show_admin_install_notice', 1 );
}
public function add_plugin_admin_menu() {
@@ -131,11 +195,27 @@ class Google_Calendar_Events_Admin {
return array_merge(
array(
+ 'settings' => '' . __( 'General Settings', 'gce' ) . '',
'feeds' => '' . __( 'Feeds', 'gce' ) . ''
- //'settings' => '' . __( 'Settings', 'gce' ) . '',
),
$links
);
+ }
+ /**
+ * Use to show an important admin notice.
+ *
+ * @since 2.0.7.1
+ */
+
+ /**
+ * Example use in constructor:
+
+ if( version_compare( $this->version, '2.1.0', '<' ) ) {
+ add_action( 'admin_notices', array( $this, 'show_admin_notice' ) );
+ }
+ */
+ function show_admin_notice() {
+ include_once( 'includes/admin/admin-notice.php' );
}
}
diff --git a/wp-content/plugins/google-calendar-events/class-google-calendar-events.php b/wp-content/plugins/google-calendar-events/class-google-calendar-events.php
index cd25c7d..aab32bd 100644
--- a/wp-content/plugins/google-calendar-events/class-google-calendar-events.php
+++ b/wp-content/plugins/google-calendar-events/class-google-calendar-events.php
@@ -18,7 +18,7 @@ class Google_Calendar_Events {
*
* @var string
*/
- protected $version = '2.0.6';
+ protected $version = '2.1.1';
/**
* Unique identifier for the plugin.
@@ -137,8 +137,9 @@ class Google_Calendar_Events {
wp_localize_script( $this->plugin_slug . '-public', 'gce',
array(
- 'ajaxurl' => admin_url( 'admin-ajax.php' ),
- 'ajaxnonce' => wp_create_nonce( 'gce_ajax_nonce' )
+ 'ajaxurl' => admin_url( 'admin-ajax.php' ),
+ 'ajaxnonce' => wp_create_nonce( 'gce_ajax_nonce' ),
+ 'loadingText' => __( 'Loading...', 'gce' )
) );
}
@@ -196,26 +197,10 @@ class Google_Calendar_Events {
* @since 2.0.0
*/
public function plugin_textdomain() {
- // Set filter for plugin's languages directory
- $gce_lang_dir = dirname( plugin_basename( GCE_MAIN_FILE ) ) . '/languages/';
- $gce_lang_dir = apply_filters( 'gce_languages_directory', $gce_lang_dir );
-
- // Traditional WordPress plugin locale filter
- $locale = apply_filters( 'plugin_locale', get_locale(), 'gce' );
- $mofile = sprintf( '%1$s-%2$s.mo', 'gce', $locale );
-
- // Setup paths to current locale file
- $mofile_local = $gce_lang_dir . $mofile;
- $mofile_global = WP_LANG_DIR . '/gce/' . $mofile;
-
- if ( file_exists( $mofile_global ) ) {
- load_textdomain( 'gce', $mofile_global );
- } elseif ( file_exists( $mofile_local ) ) {
- load_textdomain( 'gce', $mofile_local );
- } else {
- // Load the default language files
- load_plugin_textdomain( 'gce', false, $gce_lang_dir );
- }
-
+ load_plugin_textdomain(
+ 'gce',
+ false,
+ dirname( plugin_basename( GCE_MAIN_FILE ) ) . '/languages/'
+ );
}
}
diff --git a/wp-content/plugins/google-calendar-events/css/gce-style.css b/wp-content/plugins/google-calendar-events/css/gce-style.css
index 8dbf949..cce9010 100644
--- a/wp-content/plugins/google-calendar-events/css/gce-style.css
+++ b/wp-content/plugins/google-calendar-events/css/gce-style.css
@@ -1,219 +1,219 @@
-/**
- * Public facing CSS file
- *
- * @package GCE
- * @author Phil Derksen , Nick Young
- * @license GPL-2.0+
- * @copyright 2014 Phil Derksen
- */
-
-/* Base line-height for all views & tooltip */
-
-.gce-page-grid,
-.gce-page-list,
-.gce-widget-grid,
-.gce-widget-list,
-.gce-event-info {
- line-height: 1.5;
-}
-
-/* Month & list titles for all views */
-
-.gce-month-title,
-.gce-list-title {
- font-weight: bold;
- padding-bottom: 5px;
-}
-
-/* Event titles with shaded background for all views */
-
-.gce-list-event,
-.gce-tooltip-event {
- background-color: #ddd;
- padding: 0 5px;
-}
-
-/* PAGE GRID */
-
-.gce-page-grid .gce-calendar .gce-caption{ /* Caption at top of calendar */
- color:#333333;
- text-align:center;
-}
-
-.gce-page-grid .gce-calendar{ /* Main calendar table */
- width:100%;
- border-collapse:collapse;
- border:1px solid #CCCCCC;
- color:#CCCCCC;
-}
-
-.gce-page-grid .gce-calendar th{ /* Day headings (S, M etc.) */
- border:1px solid #CCCCCC;
- text-align:center;
- width:14.29%;
- padding:0;
-}
-
-.gce-page-grid .gce-calendar td{ /* Day table cells */
- border:1px solid #CCCCCC;
- text-align:center;
- height:80px;
- vertical-align:middle;
- padding:0;
-}
-
-.gce-page-grid .gce-calendar .gce-has-events{ /* Table cells with events */
- color:#333333;
- cursor:pointer;
-}
-
-.gce-page-grid .gce-calendar .gce-event-info{ /* Event information */
- display:none; /* Important! */
-}
-
-.gce-page-grid .gce-calendar .gce-day-number{ /* Day number span */
- font-size:2em;
-}
-
-.gce-page-grid .gce-calendar .gce-today{ /* Table cell that represents today */
- background-color:#DDDDDD;
-}
-
-.gce-page-grid .gce-calendar th abbr{ /* Day letter abbreviation */
- border-bottom:none;
-}
-
-/* PAGE LIST */
-
-.gce-page-list .gce-feed {
- padding-bottom: 10px;
-}
-
-.gce-page-list .gce-list p{ /* Each piece of information in the list */
- margin:0;
-}
-
-.gce-page-list .gce-list p span,
-.gce-page-list .gce-list div span{ /* The text displayed before each piece of info, 'Starts:' for example */
- color:#999999;
-}
-
-/* WIDGET GRID */
-
-.gce-widget-grid .gce-calendar .gce-caption{
- text-align:center;
-}
-
-.gce-widget-grid .gce-calendar{ /* Main calendar table */
- width:100%;
- border:1px solid #CCCCCC;
- border-collapse:collapse;
-}
-
-.gce-widget-grid .gce-calendar th{ /* Day headings (S, M etc.) */
- width:14.29%;
- border:1px solid #CCCCCC;
- text-align:center;
-}
-
-.gce-widget-grid .gce-calendar td{ /* Day table cells */
- color:#CCCCCC;
- width:14.29%;
- border:1px solid #CCCCCC;
- text-align:center;
-}
-
-.gce-widget-grid .gce-calendar .gce-has-events{ /* Table cells with events */
- cursor:pointer;
- color:#666666;
-}
-
-.gce-widget-grid .gce-calendar .gce-today{ /* Table cell that represents today */
- background-color:#DDDDDD;
-}
-
-.gce-widget-grid .gce-calendar .gce-event-info{ /* Event information */
- display:none; /* Important! */
-}
-
-.gce-widget-grid .gce-calendar th abbr{ /* Day name abbreviations */
- border-bottom:none;
-}
-
-/* WIDGET LIST */
-
-.gce-widget-list .gce-list p{ /* Each piece of information in the list */
- margin:0;
-}
-
-.gce-widget-list .gce-list p span,
-.gce-widget-list .gce-list div span{ /* The text displayed before each piece of info, 'Starts:' for example */
- color:#999999;
-}
-
-/* TOOLTIP */
-
-.gce-event-info{ /* Tooltip container */
- background-color:#FFFFFF;
- border:1px solid #333333;
- max-width:300px;
-}
-
-.gce-event-info .gce-tooltip-title{ /* 'Events on...' text */
- margin:5px;
- font-weight:bold;
- font-size:1.2em;
-}
-
-.gce-event-info ul{ /* Events list */
- padding:0;
- margin:5px;
- list-style-type:none;
-}
-
-.gce-event-info ul li{ /* Event list item */
- margin:10px 0 0 0;
-}
-
-.gce-event-info ul li p{ /* Each piece of information */
- margin:0;
-}
-
-.gce-event-info ul li p span,
-.gce-event-info ul li div span{ /* The text displayed before each piece of info, 'Starts:' for example */
- color:#999999;
-}
-
-/** Calendar navigation bar, Prev/Next links & month title. **/
-
-.gce-navbar {
- width: 100%;
- text-align: center;
- clear: both;
- overflow: hidden;
-}
-
-.gce-next,
-.gce-prev {
- white-space: nowrap;
-}
-
-.gce-prev {
- float: left;
-}
-
-.gce-next {
- float: right;
-}
-
-.gce-month-title {
- display: inline-block;
- margin: 0 auto;
- white-space: nowrap;
-}
-
-/* Grouped List */
-
-.gce-list-grouped .gce-feed {
- margin-left: 5%;
-}
+/**
+ * Public facing CSS file
+ *
+ * @package GCE
+ * @author Phil Derksen , Nick Young
+ * @license GPL-2.0+
+ * @copyright 2014 Phil Derksen
+ */
+
+/* Base line-height for all views & tooltip */
+
+.gce-page-grid,
+.gce-page-list,
+.gce-widget-grid,
+.gce-widget-list,
+.gce-event-info {
+ line-height: 1.5;
+}
+
+/* Month & list titles for all views */
+
+.gce-month-title,
+.gce-list-title {
+ font-weight: bold;
+ padding-bottom: 5px;
+}
+
+/* Event titles with shaded background for all views */
+
+.gce-list-event,
+.gce-tooltip-event {
+ background-color: #ddd;
+ padding: 0 5px;
+}
+
+/* PAGE GRID */
+
+.gce-page-grid .gce-calendar .gce-caption{ /* Caption at top of calendar */
+ color:#333333;
+ text-align:center;
+}
+
+.gce-page-grid .gce-calendar{ /* Main calendar table */
+ width:100%;
+ border-collapse:collapse;
+ border:1px solid #CCCCCC;
+ color:#CCCCCC;
+}
+
+.gce-page-grid .gce-calendar th{ /* Day headings (S, M etc.) */
+ border:1px solid #CCCCCC;
+ text-align:center;
+ width:14.29%;
+ padding:0;
+}
+
+.gce-page-grid .gce-calendar td{ /* Day table cells */
+ border:1px solid #CCCCCC;
+ text-align:center;
+ height:80px;
+ vertical-align:middle;
+ padding:0;
+}
+
+.gce-page-grid .gce-calendar .gce-has-events{ /* Table cells with events */
+ color:#333333;
+ cursor:pointer;
+}
+
+.gce-page-grid .gce-calendar .gce-event-info{ /* Event information */
+ display:none; /* Important! */
+}
+
+.gce-page-grid .gce-calendar .gce-day-number{ /* Day number span */
+ font-size:2em;
+}
+
+.gce-page-grid .gce-calendar .gce-today{ /* Table cell that represents today */
+ background-color:#DDDDDD;
+}
+
+.gce-page-grid .gce-calendar th abbr{ /* Day letter abbreviation */
+ border-bottom:none;
+}
+
+/* PAGE LIST */
+
+.gce-page-list .gce-feed {
+ padding-bottom: 10px;
+}
+
+.gce-page-list .gce-list p{ /* Each piece of information in the list */
+ margin:0;
+}
+
+.gce-page-list .gce-list p span,
+.gce-page-list .gce-list div span{ /* The text displayed before each piece of info, 'Starts:' for example */
+ color:#999999;
+}
+
+/* WIDGET GRID */
+
+.gce-widget-grid .gce-calendar .gce-caption{
+ text-align:center;
+}
+
+.gce-widget-grid .gce-calendar{ /* Main calendar table */
+ width:100%;
+ border:1px solid #CCCCCC;
+ border-collapse:collapse;
+}
+
+.gce-widget-grid .gce-calendar th{ /* Day headings (S, M etc.) */
+ width:14.29%;
+ border:1px solid #CCCCCC;
+ text-align:center;
+}
+
+.gce-widget-grid .gce-calendar td{ /* Day table cells */
+ color:#CCCCCC;
+ width:14.29%;
+ border:1px solid #CCCCCC;
+ text-align:center;
+}
+
+.gce-widget-grid .gce-calendar .gce-has-events{ /* Table cells with events */
+ cursor:pointer;
+ color:#666666;
+}
+
+.gce-widget-grid .gce-calendar .gce-today{ /* Table cell that represents today */
+ background-color:#DDDDDD;
+}
+
+.gce-widget-grid .gce-calendar .gce-event-info{ /* Event information */
+ display:none; /* Important! */
+}
+
+.gce-widget-grid .gce-calendar th abbr{ /* Day name abbreviations */
+ border-bottom:none;
+}
+
+/* WIDGET LIST */
+
+.gce-widget-list .gce-list p{ /* Each piece of information in the list */
+ margin:0;
+}
+
+.gce-widget-list .gce-list p span,
+.gce-widget-list .gce-list div span{ /* The text displayed before each piece of info, 'Starts:' for example */
+ color:#999999;
+}
+
+/* TOOLTIP */
+
+.gce-event-info{ /* Tooltip container */
+ background-color:#FFFFFF;
+ border:1px solid #333333;
+ max-width:300px;
+}
+
+.gce-event-info .gce-tooltip-title{ /* 'Events on...' text */
+ margin:5px;
+ font-weight:bold;
+ font-size:1.2em;
+}
+
+.gce-event-info ul{ /* Events list */
+ padding:0;
+ margin:5px;
+ list-style-type:none;
+}
+
+.gce-event-info ul li{ /* Event list item */
+ margin:10px 0 0 0;
+}
+
+.gce-event-info ul li p{ /* Each piece of information */
+ margin:0;
+}
+
+.gce-event-info ul li p span,
+.gce-event-info ul li div span{ /* The text displayed before each piece of info, 'Starts:' for example */
+ color:#999999;
+}
+
+/** Calendar navigation bar, Prev/Next links & month title. **/
+
+.gce-navbar {
+ width: 100%;
+ text-align: center;
+ clear: both;
+ overflow: hidden;
+}
+
+.gce-next,
+.gce-prev {
+ white-space: nowrap;
+}
+
+.gce-prev {
+ float: left;
+}
+
+.gce-next {
+ float: right;
+}
+
+.gce-month-title {
+ display: inline-block;
+ margin: 0 auto;
+ white-space: nowrap;
+}
+
+/* Grouped List */
+
+.gce-list-grouped .gce-feed {
+ margin-left: 5%;
+}
diff --git a/wp-content/plugins/google-calendar-events/google-calendar-events.php b/wp-content/plugins/google-calendar-events/google-calendar-events.php
index 4239d1c..9643aab 100644
--- a/wp-content/plugins/google-calendar-events/google-calendar-events.php
+++ b/wp-content/plugins/google-calendar-events/google-calendar-events.php
@@ -1,60 +1,67 @@
-, Nick Young
- * @license GPL-2.0+
- * @link http://philderksen.com
- * @copyright 2014 Phil Derksen
- *
- * @wordpress-plugin
- * Plugin Name: Google Calendar Events
- * Plugin URI: https://github.com/pderksen/WP-Google-Calendar-Events
- * Description: Parses Google Calendar feeds and displays the events as a calendar grid or list on a page, post or widget.
- * Version: 2.0.6
- * Author: Phil Derksen
- * Author URI: http://philderksen.com
- * License: GPL-2.0+
- * License URI: http://www.gnu.org/licenses/gpl-2.0.txt
- * Text Domain: gce
- * Domain Path: /languages
- */
-
-// If this file is called directly, abort.
-if ( ! defined( 'WPINC' ) ) {
- die;
-}
-
-/*
- * Include the main plugin file
- *
- * @since 2.0.0
- */
-require_once( 'class-google-calendar-events.php' );
-
-/**
- * Define constant pointing to this file
- *
- * @since 2.0.0
- */
-if( ! defined( 'GCE_MAIN_FILE' ) ) {
- define( 'GCE_MAIN_FILE', __FILE__ );
-}
-
-/*
- * Get instance of our plugin
- *
- * @since 2.0.0
- */
-add_action( 'plugins_loaded', array( 'Google_Calendar_Events', 'get_instance' ) );
-
-/*
- * If we are in admin then load the Admin class
- *
- * @since 2.0.0
- */
-if ( is_admin() && ( ! defined( 'DOING_AJAX' ) || ! DOING_AJAX ) ) {
- require_once( 'class-google-calendar-events-admin.php' );
- add_action( 'plugins_loaded', array( 'Google_Calendar_Events_Admin', 'get_instance' ) );
-}
+, Nick Young
+ * @license GPL-2.0+
+ * @link http://philderksen.com
+ * @copyright 2014 Phil Derksen
+ *
+ * @wordpress-plugin
+ * Plugin Name: Google Calendar Events
+ * Plugin URI: https://github.com/pderksen/WP-Google-Calendar-Events
+ * Description: Parses Google Calendar feeds and displays the events as a calendar grid or list on a page, post or widget.
+ * Version: 2.1.1
+ * Author: Phil Derksen
+ * Author URI: http://philderksen.com
+ * License: GPL-2.0+
+ * License URI: http://www.gnu.org/licenses/gpl-2.0.txt
+ * Text Domain: gce
+ * Domain Path: /languages
+ */
+
+// If this file is called directly, abort.
+if ( ! defined( 'WPINC' ) ) {
+ die;
+}
+
+/*
+ * Include the main plugin file
+ *
+ * @since 2.0.0
+ */
+require_once( 'class-google-calendar-events.php' );
+
+/**
+ * Define constant pointing to this file
+ *
+ * @since 2.0.0
+ */
+if( ! defined( 'GCE_MAIN_FILE' ) ) {
+ define( 'GCE_MAIN_FILE', __FILE__ );
+}
+
+/*
+ * Get instance of our plugin
+ *
+ * @since 2.0.0
+ */
+add_action( 'plugins_loaded', array( 'Google_Calendar_Events', 'get_instance' ) );
+
+/*
+ * If we are in admin then load the Admin class
+ *
+ * @since 2.0.0
+ */
+if ( is_admin() && ( ! defined( 'DOING_AJAX' ) || ! DOING_AJAX ) ) {
+ require_once( 'class-google-calendar-events-admin.php' );
+
+ // Register hooks that are fired when the plugin is activated, deactivated, and uninstalled, respectively.
+ register_activation_hook( __FILE__, array( 'Google_Calendar_Events_Admin', 'activate' ) );
+
+ // Get plugin admin class instance
+ add_action( 'plugins_loaded', array( 'Google_Calendar_Events_Admin', 'get_instance' ) );
+}
+
+
diff --git a/wp-content/plugins/google-calendar-events/includes/admin/admin-functions.php b/wp-content/plugins/google-calendar-events/includes/admin/admin-functions.php
index b35bc0d..1d97759 100644
--- a/wp-content/plugins/google-calendar-events/includes/admin/admin-functions.php
+++ b/wp-content/plugins/google-calendar-events/includes/admin/admin-functions.php
@@ -32,11 +32,11 @@ function gce_default_editor_content( $content, $post ) {
if( $post->post_type == 'gce_feed' ) {
$content = '
+ GCal Events Important Update Nov. 17, 2014:
+ Google took version 2 of the GCal API offline, which breaks all calendar feed displays.
+ Here's a temporary fix for your calendar display
+ while we move the plugin to using the new GCal API this week. Thanks for your patience.
+
+
diff --git a/wp-content/plugins/google-calendar-events/includes/admin/upgrade.php b/wp-content/plugins/google-calendar-events/includes/admin/upgrade.php
index 5902395..41b5873 100644
--- a/wp-content/plugins/google-calendar-events/includes/admin/upgrade.php
+++ b/wp-content/plugins/google-calendar-events/includes/admin/upgrade.php
@@ -22,6 +22,10 @@ function gce_upgrade() {
$version = get_option( 'gce_version' );
if( ! empty( $version ) ) {
+
+ // Clear out cache when upgrading no matter the version
+ gce_upgrade_clear_cache();
+
// Check if under version 2 and run the v2 upgrade if we are
if( version_compare( $version, '2.0.0-beta1', '<' ) && false === get_option( 'gce_upgrade_has_run' ) ) {
gce_v2_upgrade();
@@ -36,6 +40,10 @@ function gce_upgrade() {
if( version_compare( $version, '2.0.6', '<' ) ) {
gce_v206_upgrade();
}
+
+ if( version_compare( $version, '2.1.0', '<' ) ) {
+ gce_v210_upgrade();
+ }
}
$new_version = Google_Calendar_Events::get_instance()->get_plugin_version();
@@ -44,6 +52,30 @@ function gce_upgrade() {
add_option( 'gce_upgrade_has_run', 1 );
}
+/*
+ * Run the upgrade to version 2.1.0
+ */
+function gce_v210_upgrade() {
+
+ $q = new WP_Query( 'post_type=gce_feed' );
+
+ if( $q->have_posts() ) {
+ while( $q->have_posts() ) {
+ $q->the_post();
+
+ $url = get_post_meta( get_the_ID(), 'gce_feed_url', true );
+
+ // https://www.google.com/calendar/feeds/umsb0ekhivs1a2ubtq6vlqvcjk%40group.calendar.google.com/public/basic
+
+ $url = str_replace( 'https://www.google.com/calendar/feeds/', '', $url );
+ $url = str_replace( '/public/basic', '', $url );
+ $url = str_replace( '%40', '@', $url );
+
+ update_post_meta( get_the_ID(), 'gce_feed_url', $url );
+ }
+ }
+}
+
/*
* Run the upgrade to version 2.0.6
*
@@ -336,4 +368,23 @@ function update_widget_feed_ids() {
update_option( 'widget_gce_widget', $widget );
}
+}
+
+/**
+ * Update widget IDs
+ *
+ * @since 2.0.6.3
+ */
+function gce_upgrade_clear_cache() {
+ // Update feeds
+ $q = new WP_Query( 'post_type=gce_feed' );
+
+ if( $q->have_posts() ) {
+ while( $q->have_posts() ) {
+
+ $q->the_post();
+
+ delete_transient( 'gce_feed_' . get_the_ID() );
+ }
+ }
}
\ No newline at end of file
diff --git a/wp-content/plugins/google-calendar-events/includes/class-gce-display.php b/wp-content/plugins/google-calendar-events/includes/class-gce-display.php
index 28c3454..76077f5 100644
--- a/wp-content/plugins/google-calendar-events/includes/class-gce-display.php
+++ b/wp-content/plugins/google-calendar-events/includes/class-gce-display.php
@@ -56,20 +56,12 @@ class GCE_Display {
*/
private function get_event_days() {
$event_days = array();
-
- //Total number of events retrieved
- $count = count( $this->merged_feeds );
- //Loop through entire array of events, or until maximum number of events to be displayed has been reached
- for ( $i = 0; $i < $count; $i++ ) {
- $event = $this->merged_feeds[$i];
-
- //Check that event ends, or starts (or both) within the required date range. This prevents all-day events from before / after date range from showing up.
- //if ( $event->end_time > $event->start_time && $event->start_time < $event->end_time ) {
- foreach ( $event->get_days() as $day ) {
- $event_days[$day][] = $event;
- }
+ foreach ( $this->merged_feeds as $event ) {
+ foreach ( $event->get_days() as $day ) {
+ $event_days[$day][] = $event;
}
+ }
return $event_days;
}
@@ -112,8 +104,7 @@ class GCE_Display {
//Array of previous and next link stuff for use in gce_generate_calendar (below)
foreach( $event_days as $key => $event_day ) {
-
- if( $paging == null && $paging != 0 ) {
+ if( $paging === null ) {
$paging = get_post_meta( $event_day[0]->feed->id, 'gce_paging', true );
}
}
@@ -223,25 +214,26 @@ class GCE_Display {
// Get all the event days
$event_days = $this->get_event_days();
- foreach( $event_days as $key => $event_day ) {
- if( $paging_interval == null ) {
- $max_num = get_post_meta( $event_day[0]->feed->id, 'gce_list_max_num', true );
-
- if( $paging_type == null ) {
- $max_length = get_post_meta( $event_day[0]->feed->id, 'gce_list_max_length', true );
- $paging_type = $max_length;
- }
- }
-
- if( $paging == null && $paging != 0 ) {
- $paging = get_post_meta( $event_day[0]->feed->id, 'gce_paging', true );
- }
+ $an_event_feed_id = current( $event_days );
+ $an_event_feed_id = $an_event_feed_id[0]->feed->id;
+
+ if( $paging_interval == null ) {
+ $max_num = get_post_meta( $an_event_feed_id, 'gce_list_max_num', true );
- if( $start_offset == null && $start_offset != 0 ) {
- $start_offset_num = get_post_meta( $event_day[0]->feed->id, 'gce_list_start_offset_num', true );
- $start_offset_direction = get_post_meta( $event_day[0]->feed->id, 'gce_list_start_offset_direction', true );
+ if( $paging_type == null ) {
+ $max_length = get_post_meta( $an_event_feed_id, 'gce_list_max_length', true );
+ $paging_type = $max_length;
}
}
+
+ if( $paging === null ) {
+ $paging = get_post_meta( $an_event_feed_id, 'gce_paging', true );
+ }
+
+ if( $start_offset === null ) {
+ $start_offset_num = get_post_meta( $an_event_feed_id, 'gce_list_start_offset_num', true );
+ $start_offset_direction = get_post_meta( $an_event_feed_id, 'gce_list_start_offset_direction', true );
+ }
if( empty( $max_num ) || $max_num == 0 ) {
$max_num = 7;
@@ -251,7 +243,7 @@ class GCE_Display {
$paging_interval = $max_num * 86400;
}
- if( $start_offset == null && $start_offset != 0 ) {
+ if( $start_offset === null ) {
if( $start_offset_direction == 'back' ) {
$start_offset_direction = -1;
} else {
@@ -274,8 +266,15 @@ class GCE_Display {
$markup = '
';
-
- $has_events = true;
-
- $i++;
-
- $event_counter++;
- }
+ $has_events = true;
+ $i++;
+ $event_counter++;
}
}
diff --git a/wp-content/plugins/google-calendar-events/includes/class-gce-event.php b/wp-content/plugins/google-calendar-events/includes/class-gce-event.php
index 3a1f1d9..7e0edef 100644
--- a/wp-content/plugins/google-calendar-events/includes/class-gce-event.php
+++ b/wp-content/plugins/google-calendar-events/includes/class-gce-event.php
@@ -50,32 +50,37 @@ class GCE_Event {
*
* @since 2.0.0
*/
- function get_days() {
- //Round start date to nearest day
- $start_time = mktime( 0, 0, 0, date( 'm', $this->start_time ), date( 'd', $this->start_time ) , date( 'Y', $this->start_time ) );
+ function get_days() {
+
+ if( $this->start_time !== null ) {
+ //Round start date to nearest day
+ $start_time = mktime( 0, 0, 0, date( 'm', $this->start_time ), date( 'd', $this->start_time ) , date( 'Y', $this->start_time ) );
- $days = array();
+ $days = array();
- //If multiple day events should be handled, and this event is a multi-day event, add multiple day event to required days
- if ( $this->feed->multiple_day_events && ( 'MPD' == $this->day_type || 'MWD' == $this->day_type ) ) {
- $on_next_day = true;
- $next_day = $start_time;
+ //If multiple day events should be handled, and this event is a multi-day event, add multiple day event to required days
+ if ( $this->feed->multiple_day_events && ( 'MPD' == $this->day_type || 'MWD' == $this->day_type ) ) {
+ $on_next_day = true;
+ $next_day = $start_time;
- while ( $on_next_day ) {
- //If the end time of the event is after 00:00 on the next day (therefore, not doesn't end on this day)
- if ( $this->end_time > $next_day ) {
- $days[] = $next_day;
- } else {
- $on_next_day = false;
+ while ( $on_next_day ) {
+ //If the end time of the event is after 00:00 on the next day (therefore, not doesn't end on this day)
+ if ( $this->end_time > $next_day ) {
+ $days[] = $next_day;
+ } else {
+ $on_next_day = false;
+ }
+ $next_day += 86400;
}
- $next_day += 86400;
+ } else {
+ //Add event into array of events for that day
+ $days[] = $start_time;
}
- } else {
- //Add event into array of events for that day
- $days[] = $start_time;
- }
- return $days;
+ return $days;
+ } else {
+ return array();
+ }
}
/**
@@ -84,10 +89,6 @@ class GCE_Event {
* @since 2.0.0
*/
function get_event_markup( $display_type, $num_in_day, $num ) {
-
-
-
-
//Set the display type (either tooltip or list)
$this->type = $display_type;
diff --git a/wp-content/plugins/google-calendar-events/includes/class-gce-feed.php b/wp-content/plugins/google-calendar-events/includes/class-gce-feed.php
index 209c08b..e270e38 100644
--- a/wp-content/plugins/google-calendar-events/includes/class-gce-feed.php
+++ b/wp-content/plugins/google-calendar-events/includes/class-gce-feed.php
@@ -12,6 +12,7 @@
class GCE_Feed {
public $id,
+ $calendar_id,
$feed_url,
$date_format,
$time_format,
@@ -24,6 +25,9 @@ class GCE_Feed {
public $events = array();
+ // Google API Key
+ private $api_key = 'AIzaSyAssdKVved1mPVY0UJCrx96OUOF9u17AuY';
+
/**
* Class constructor
*
@@ -33,12 +37,13 @@ class GCE_Feed {
// Set the ID
$this->id = $id;
+ $this->calendar_id = get_post_meta( $this->id, 'gce_feed_url', true );
+
// Set up all other data based on the ID
$this->setup_attributes();
// Now create the Feed
$this->create_feed();
-
}
/**
@@ -77,6 +82,8 @@ class GCE_Feed {
private function create_feed() {
//Break the feed URL up into its parts (scheme, host, path, query)
+ global $gce_options;
+
if( empty( $this->feed_url ) ) {
if( current_user_can( 'manage_options' ) ) {
echo '
' . __( 'The feed URL has not been set. Please make sure to set it correctly in the Feed settings.', 'gce' ) . '
';
@@ -85,51 +92,42 @@ class GCE_Feed {
return;
}
- $url_parts = parse_url( $this->feed_url );
+ $args = array();
- $scheme = ( is_ssl() ? 'https://' : 'http://' );
-
- $scheme_and_host = $scheme . $url_parts['host'];
-
- //Remove the exisitng projection from the path, and replace it with '/full-noattendees'
- $path = substr( $url_parts['path'], 0, strrpos( $url_parts['path'], '/' ) ) . '/full-noattendees';
-
- //Add the default parameters to the querystring (retrieving JSON, not XML)
- $query = '?alt=json&sortorder=ascending&orderby=starttime';
+ if( ! empty( $gce_options['api_key'] ) ) {
+ $api_key = $gce_options['api_key'];
+ } else {
+ $api_key = $this->api_key;
+ }
- $start = $this->get_feed_start();
+ $query = 'https://www.googleapis.com/calendar/v3/calendars/' . $this->calendar_id . '/events';
- $end = $this->get_feed_end();
+ // Set API key
+ $query .= '?key=' . $api_key;
- $gmt_offset = abs( get_option( 'gmt_offset' ) * 3600 );
+ $args['orderBy'] = 'startTime';
- $query .= '&start-min=' . date( 'Y-m-d\TH:i:s', $start - $gmt_offset );
+ $args['timeMin'] = urlencode( $this->get_feed_start() );
- $query .= '&start-max=' . date( 'Y-m-d\TH:i:s', $end - $gmt_offset );
+ $args['timeMax'] = urlencode( $this->get_feed_end() );
-
- // Max results limit for performance.
- $query .= '&max-results=10000';
+ $args['maxResults'] = 10000;
$ctz = get_option( 'timezone_string' );
if( ! empty( $ctz ) ) {
- $query .= '&ctz=' . $ctz;
+ $args['timeZone'] = $ctz;
}
if ( ! empty( $this->search_query ) ) {
- $query .= '&q=' . rawurlencode( $this->search_query );
+ $args['q'] = rawurlencode( $this->search_query );
}
- if ( $this->expand_recurring ) {
- $query .= '&singleevents=true';
- }
-
- //Put the URL back together
- $this->display_url = $scheme_and_host . $path . $query;
+ $args['singleEvents'] = 'true';
- // Get all the feed data
- $this->get_feed_data( $this->display_url );
+ $query = add_query_arg( $args, $query );
+
+ $this->get_feed_data( $query );
}
/**
@@ -138,62 +136,56 @@ class GCE_Feed {
* @since 2.0.0
*/
private function get_feed_data( $url ) {
-
+
// First check for transient data to use
if( false !== get_transient( 'gce_feed_' . $this->id ) ) {
$this->events = get_transient( 'gce_feed_' . $this->id );
} else {
-
- // Moved the remote get here to be more efficient
- // Pointed out to us by John McManigle ( github.com/mcmanigle )
$raw_data = wp_remote_get( $url, array(
- 'sslverify' => false, //sslverify is set to false to ensure https URLs work reliably. Data source is Google's servers, so is trustworthy
- 'timeout' => 10 //Increase timeout from the default 5 seconds to ensure even large feeds are retrieved successfully
- ) );
-
+ 'sslverify' => false, //sslverify is set to false to ensure https URLs work reliably. Data source is Google's servers, so is trustworthy
+ 'timeout' => 10 //Increase timeout from the default 5 seconds to ensure even large feeds are retrieved successfully
+ ) );
//If $raw_data is a WP_Error, something went wrong
if ( ! is_wp_error( $raw_data ) ) {
- //If response code isn't 200, something went wrong
- if ( 200 == $raw_data['response']['code'] ) {
//Attempt to convert the returned JSON into an array
$raw_data = json_decode( $raw_data['body'], true );
//If decoding was successful
if ( ! empty( $raw_data ) ) {
//If there are some entries (events) to process
- if ( isset( $raw_data['feed']['entry'] ) ) {
+ //if ( isset( $raw_data['feed']['entry'] ) ) {
//Loop through each event, extracting the relevant information
- foreach ( $raw_data['feed']['entry'] as $event ) {
- $id = ( isset( $event['gCal$uid']['value'] ) ? esc_html( substr( $event['gCal$uid']['value'], 0, strpos( $event['gCal$uid']['value'], '@' ) ) ) : '' );
- $title = ( isset( $event['title']['$t'] ) ? esc_html( $event['title']['$t'] ) : '' );
- $description = ( isset( $event['content']['$t'] ) ? esc_html( $event['content']['$t'] ) : '' );
- $link = ( isset( $event['link'][0]['href'] ) ? esc_url( $event['link'][0]['href'] ) : '' );
- $location = ( isset( $event['gd$where'][0]['valueString'] ) ? esc_html( $event['gd$where'][0]['valueString'] ) : '' );
- $start_time = ( isset( $event['gd$when'][0]['startTime'] ) ? $this->iso_to_ts( $event['gd$when'][0]['startTime'] ) : '' );
- $end_time = ( isset( $event['gd$when'][0]['endTime'] ) ? $this->iso_to_ts( $event['gd$when'][0]['endTime'] ) : '' );
-
+ foreach ( $raw_data['items'] as $event ) {
+ $id = ( isset( $event['id'] ) ? esc_html( $event['id'] ) : '' );
+ $title = ( isset( $event['summary'] ) ? esc_html( $event['summary'] ) : '' );
+ $description = ( isset( $event['description'] ) ? esc_html( $event['description'] ) : '' );
+ $link = ( isset( $event['htmlLink'] ) ? esc_url( $event['htmlLink'] ) : '' );
+ $location = ( isset( $event['location'] ) ? esc_html( $event['location'] ) : '' );
+
+ if( isset( $event['start']['dateTime'] ) ) {
+ $start_time = $this->iso_to_ts( $event['start']['dateTime'] );
+ } else if( isset( $event['start']['date'] ) ) {
+ $start_time = $this->iso_to_ts( $event['start']['date'] );
+ } else {
+ $start_time = null;
+ }
+
+ if( isset( $event['end']['dateTime'] ) ) {
+ $end_time = $this->iso_to_ts( $event['end']['dateTime'] );
+ } else if( isset( $event['end']['date'] ) ) {
+ $end_time = $this->iso_to_ts( $event['end']['date'] );
+ } else {
+ $end_time = null;
+ }
+
//Create a GCE_Event using the above data. Add it to the array of events
$this->events[] = new GCE_Event( $this, $id, $title, $description, $location, $start_time, $end_time, $link );
}
- }
} else {
//json_decode failed
- $this->error = __( 'Some data was retrieved, but could not be parsed successfully. Please ensure your feed URL is correct.', 'gce' );
+ $this->error = __( 'Some data was retrieved, but could not be parsed successfully. Please ensure your feed settings are correct.', 'gce' );
}
- } else {
- //The response code wasn't 200, so generate a helpful(ish) error message depending on error code
- switch ( $raw_data['response']['code'] ) {
- case 404:
- $this->error = __( 'The feed could not be found (404). Please ensure your feed URL is correct.', 'gce' );
- break;
- case 403:
- $this->error = __( 'Access to this feed was denied (403). Please ensure you have public sharing enabled for your calendar.', 'gce' );
- break;
- default:
- $this->error = sprintf( __( 'The feed data could not be retrieved. Error code: %s. Please ensure your feed URL is correct.', 'gce' ), $raw_data['response']['code'] );
- }
- }
- }else{
+ } else{
//Generate an error message from the returned WP_Error
$this->error = $raw_data->get_error_message() . __( ' Please ensure your feed URL is correct.', 'gce' );
}
@@ -228,15 +220,15 @@ class GCE_Feed {
switch( $interval ) {
case 'days':
- return time() - ( $start * 86400 );
+ return date( 'c', time() - ( $start * 86400 ) );
case 'months':
- return time() - ( $start * 2629743 );
+ return date( 'c', time() - ( $start * 2629743 ) );
case 'years':
- return time() - ( $start * 31556926 );
+ return date( 'c', time() - ( $start * 31556926 ) );
}
// fall back just in case. Falls back to 1 year ago
- return time() - 31556926;
+ return date( 'c', time() - 31556926 );
}
private function get_feed_end() {
@@ -246,15 +238,15 @@ class GCE_Feed {
switch( $interval ) {
case 'days':
- return time() + ( $end * 86400 );
+ return date( 'c', time() + ( $end * 86400 ) );
case 'months':
- return time() + ( $end * 2629743 );
+ return date( 'c', time() + ( $end * 2629743 ) );
case 'years':
- return time() + ( $end * 31556926 );
+ return date( 'c', time() + ( $end * 31556926 ) );
}
// Falls back to 1 year ahead just in case
- return time() + 31556926;
+ return date( 'c', time() + 31556926 );
}
function get_builder() {
diff --git a/wp-content/plugins/google-calendar-events/includes/gce-feed-cpt.php b/wp-content/plugins/google-calendar-events/includes/gce-feed-cpt.php
index 8e4751b..63b4c09 100644
--- a/wp-content/plugins/google-calendar-events/includes/gce-feed-cpt.php
+++ b/wp-content/plugins/google-calendar-events/includes/gce-feed-cpt.php
@@ -67,9 +67,9 @@ function gce_feed_messages( $messages ) {
global $post, $post_ID;
$url1 = '';
- $url2 = 'feed';
+ $url2 = __( 'feed', 'gce' );
$url3 = '';
- $s1 = 'Feed';
+ $s1 = __( 'Feed', 'gce' );
$messages['gce_feed'] = array(
1 => sprintf( __( '%4$s updated. %1$sView %2$s%3$s', 'gce' ), $url1, $url2, $url3, $s1 ),
@@ -94,7 +94,7 @@ function gce_cpt_meta() {
add_meta_box( 'gce_feed_meta', 'Feed Settings', 'gce_display_meta', 'gce_feed', 'advanced', 'core' );
// Sidebar meta box below publish section.
- add_meta_box( 'gce_feed_sidebar_help', 'Helpful Links', 'gce_feed_sidebar_help', 'gce_feed', 'side', 'core' );
+ add_meta_box( 'gce_feed_sidebar_help', __( 'Helpful Links', 'gce' ), 'gce_feed_sidebar_help', 'gce_feed', 'side', 'core' );
add_meta_box( 'gce_display_options_meta', 'Display Options', 'gce_display_options_meta', 'gce_feed', 'side', 'core' );
}
@@ -182,7 +182,15 @@ function gce_save_meta( $post_id ) {
foreach ( $post_meta_fields as $pmf ) {
if ( isset( $_POST[$pmf] ) && ! empty( $_POST[$pmf] ) ) {
if( $pmf == 'gce_feed_url' ) {
- update_post_meta( $post_id, $pmf, esc_url( $_POST[$pmf] ) );
+
+ $str = $_POST[$pmf];
+
+ // convert from URL if user enters a URL link (like the old versions required)
+ $id = str_replace( 'https://www.google.com/calendar/feeds/', '', $str );
+ $id = str_replace( '/public/basic', '', $id );
+ $id = str_replace( '%40', '@', $id );
+
+ update_post_meta( $post_id, $pmf, $id );
} else {
update_post_meta( $post_id, $pmf, stripslashes( $_POST[$pmf] ) );
}
diff --git a/wp-content/plugins/google-calendar-events/includes/misc-functions.php b/wp-content/plugins/google-calendar-events/includes/misc-functions.php
index 3623b8d..c6867c2 100644
--- a/wp-content/plugins/google-calendar-events/includes/misc-functions.php
+++ b/wp-content/plugins/google-calendar-events/includes/misc-functions.php
@@ -6,8 +6,8 @@
* @since 2.0.0
*/
function gce_print_calendar( $feed_ids, $display = 'grid', $args = array(), $widget = false ) {
-
- $defaults = array(
+
+ $defaults = array(
'title_text' => '',
'sort' => 'asc',
'grouped' => 0,
@@ -47,7 +47,7 @@ function gce_print_calendar( $feed_ids, $display = 'grid', $args = array(), $wid
// If paging is not set then we need to set it now
foreach( $ids as $id ) {
- if( $paging == null && $paging != 0 ) {
+ if( $paging === null ) {
$paging = get_post_meta( $id, 'gce_paging', true );
}
}
@@ -94,7 +94,7 @@ function gce_print_calendar( $feed_ids, $display = 'grid', $args = array(), $wid
$i++;
}
}
-
+
return $markup;
}
@@ -237,3 +237,4 @@ function gce_ga_campaign_url( $base_url, $source, $medium, $campaign ) {
return $url;
}
+
diff --git a/wp-content/plugins/google-calendar-events/includes/php-calendar.php b/wp-content/plugins/google-calendar-events/includes/php-calendar.php
index 70c4744..2fcbee8 100644
--- a/wp-content/plugins/google-calendar-events/includes/php-calendar.php
+++ b/wp-content/plugins/google-calendar-events/includes/php-calendar.php
@@ -45,6 +45,12 @@ function gce_generate_calendar( $year, $month, $days = array(), $day_name_length
list( $p, $pl ) = each( $pn );
list( $n, $nl ) = each( $pn ); #previous and next links, if applicable
+ // Previous filter
+ $p = apply_filters( 'gce_prev_text', $p );
+
+ // Next filter
+ $n = apply_filters( 'gce_next_text', $n );
+
if( $widget ) {
$p = '
- 'dsq_comment')); - ?> -
- - 1 && get_option('page_comments')): // Are there comments to navigate through? ?> -