/* Plugin Name: Dummy Description: Version: 1.0 Author: Janis Elsts ModuleID: dummy ModuleCategory: container ModuleClassName: blcDummyManager ModuleAlwaysActive: true ModuleHidden: true */ /** * A "dummy" container class that can be used as a fallback when the real container class can't be found. * * * @package Broken Link Checker * @access public */ class blcDummyContainer extends blcContainer{ function synch(){ //Just mark it as synched so that it doesn't bother us anymore. $this->mark_as_synched(); } function edit_link($field_name, $parser, $new_url, $old_url = '', $old_raw_url = '', $new_text = null){ return new WP_Error( 'container_not_found', sprintf( __("I don't know how to edit a '%s' [%d].", 'broken-link-checker'), $this->container_type, $this->container_id ) ); } function unlink($field_name, $parser, $url, $raw_url =''){ return new WP_Error( 'container_not_found', sprintf( __("I don't know how to edit a '%s' [%d].", 'broken-link-checker'), $this->container_type, $this->container_id ) ); } function ui_get_source($container_field, $context = 'display'){ return sprintf( 'Unknown source %s[%d]:%s', $this->container_type, $this->container_id, $container_field ); } } /** * A dummy manager class. * * @package Broken Link Checker * @access public */ class blcDummyManager extends blcContainerManager { var $container_class_name = 'blcDummyContainer'; function resynch($forced = false){ //Do nothing. } } /* Plugin Name: Comments Description: Version: 1.0 Author: Janis Elsts ModuleID: comment ModuleCategory: container ModuleClassName: blcCommentManager */ class blcComment extends blcContainer{ /** * Retrieve the comment wrapped by this container. * The fetched object will also be cached in the $wrapped_object variable. * * @access protected * * @param bool $ensure_consistency * @return object The comment. */ function get_wrapped_object($ensure_consistency = false){ if( $ensure_consistency || is_null($this->wrapped_object) ){ $this->wrapped_object = get_comment($this->container_id); } return $this->wrapped_object; } /** * Update the comment wrapped by the container with values currently in the $wrapped_object. * * @access protected * * @return bool|WP_Error True on success, an error if something went wrong. */ function update_wrapped_object(){ if ( is_null($this->wrapped_object) ){ return new WP_Error( 'no_wrapped_object', __('Nothing to update', 'broken-link-checker') ); } $data = (array)$this->wrapped_object; if ( wp_update_comment($data) ){ return true; } else { return new WP_Error( 'update_failed', sprintf(__('Updating comment %d failed', 'broken-link-checker'), $this->container_id) ); } } /** * Delete the comment corresponding to this container. * This will actually move the comment to the trash in newer versions of WP. * * @return bool|WP_error */ function delete_wrapped_object(){ if ( EMPTY_TRASH_DAYS ){ return $this->trash_wrapped_object(); } else { if ( wp_delete_comment($this->container_id, true) ){ return true; } else { return new WP_Error( 'delete_failed', sprintf( __('Failed to delete comment %d', 'broken-link-checker'), $this->container_id ) ); } } } /** * Delete the comment corresponding to this container. * This will actually move the comment to the trash in newer versions of WP. * * @return bool|WP_error */ function trash_wrapped_object(){ if ( wp_trash_comment($this->container_id) ){ return true; } else { return new WP_Error( 'trash_failed', sprintf( __('Can\'t move comment %d to the trash', 'broken-link-checker'), $this->container_id ) ); } } /** * Check if the current user can delete/trash this comment. * * @return bool */ function current_user_can_delete(){ //TODO: Fix for custom post types? WP itself doesn't care, at least in 3.0. $comment = $this->get_wrapped_object(); return current_user_can('edit_post', $comment->comment_post_ID); } function can_be_trashed(){ return defined('EMPTY_TRASH_DAYS') && EMPTY_TRASH_DAYS; } /** * Get the default link text to use for links found in a specific container field. * For links in the comment body there is no default link text. For author links, * the link text will be equal to the author name + comment type (if any). * * @param string $field * @return string */ function default_link_text($field = ''){ if ( $field == 'comment_author_url' ){ $w = $this->get_wrapped_object(); if ( !is_null($w) ){ $text = $w->comment_author; //This lets us identify pingbacks & trackbacks. if ( !empty($w->comment_type) ){ $text .= sprintf(' [%s]', $w->comment_type); } return $text; } } return ''; } function ui_get_action_links($container_field){ $actions = array(); $comment = $this->get_wrapped_object(); $post = get_post($comment->comment_post_ID); /* @var StdClass $post */ //If the post type no longer exists, we can't really do anything with this comment. //WordPress will just throw errors if we try. if ( !post_type_exists(get_post_type($post)) ) { return $actions; } //Display Edit & Delete/Trash links only if the user has the right caps. $user_can = current_user_can('edit_post', $comment->comment_post_ID); if ( $user_can ){ $actions['edit'] = "". __('Edit') . ''; $del_nonce = esc_html( '_wpnonce=' . wp_create_nonce( "delete-comment_$comment->comment_ID" ) ); $trash_url = esc_url( admin_url("comment.php?action=trashcomment&p=$post->ID&c=$comment->comment_ID&$del_nonce") ); $delete_url = esc_url( admin_url("comment.php?action=deletecomment&p=$post->ID&c=$comment->comment_ID&$del_nonce") ); if ( !constant('EMPTY_TRASH_DAYS') ) { $actions['delete'] = "" . __('Delete Permanently') . ''; } else { $actions['trash'] = "" . _x('Trash', 'verb') . ''; } } $actions['view'] = '' . __('View') . ''; return $actions; } function ui_get_source($container_field = '', $context = 'display'){ //Display a comment icon. if ( $container_field == 'comment_author_url' ){ $image = 'font-awesome/font-awesome-user.png'; } else { $image = 'font-awesome/font-awesome-comment-alt.png'; } $image = sprintf( '%3$s ', WP_PLUGIN_URL, $image, __('Comment', 'broken-link-checker') ); $comment = $this->get_wrapped_object(); //Display a small text sample from the comment $text_sample = strip_tags($comment->comment_content); $text_sample = blcUtility::truncate($text_sample, 65); $html = sprintf( '%s — %s', $this->get_edit_url(), esc_attr__('Edit comment'), esc_attr($comment->comment_author), $text_sample ); //Don't show the image in email notifications. if ( $context != 'email' ){ $html = $image . $html; } return $html; } function get_edit_url(){ return esc_url(admin_url("comment.php?action=editcomment&c={$this->container_id}")); } function base_url(){ $comment_permalink = get_comment_link($this->container_id); return substr($comment_permalink, 0, strpos($comment_permalink, '#')); } } class blcCommentManager extends blcContainerManager { var $container_class_name = 'blcComment'; var $fields = array( 'comment_author_url' => 'url_field', 'comment_content' => 'html', ); function init(){ parent::init(); add_action('post_comment', array($this, 'hook_post_comment'), 10, 2); add_action('edit_comment', array($this, 'hook_edit_comment')); add_action('transition_comment_status', array($this, 'hook_comment_status'), 10, 3); add_action('trashed_post_comments', array($this, 'hook_trashed_post_comments'), 10, 2); add_action('untrash_post_comments', array($this, 'hook_untrash_post_comments')); } function hook_post_comment($comment_id, $comment_status){ if ( $comment_status == '1' ) { $container = blcContainerHelper::get_container(array($this->container_type, $comment_id)); $container->mark_as_unsynched(); } } function hook_edit_comment($comment_id){ if ( wp_get_comment_status($comment_id) == 'approved' ){ $container = blcContainerHelper::get_container(array($this->container_type, $comment_id)); $container->mark_as_unsynched(); } } function hook_comment_status($new_status, $old_status, $comment){ //We only care about approved comments. if ( ($new_status == 'approved') || ($old_status == 'approved') ){ $container = blcContainerHelper::get_container(array($this->container_type, $comment->comment_ID)); if ($new_status == 'approved') { $container->mark_as_unsynched(); } else { $container->delete(); blc_cleanup_links(); } } } function hook_trashed_post_comments(/** @noinspection PhpUnusedParameterInspection */$post_id, $statuses){ foreach($statuses as $comment_id => $comment_status){ if ( $comment_status == '1' ){ $container = blcContainerHelper::get_container(array($this->container_type, $comment_id)); $container->delete(); } } blc_cleanup_links(); } function hook_untrash_post_comments($post_id){ //Unlike with the 'trashed_post_comments' hook, WP doesn't pass the list of (un)trashed //comments to callbacks assigned to the 'untrash_post_comments' and 'untrashed_post_comments' //actions. Therefore, we must read it from the appropriate metadata entry. $statuses = get_post_meta($post_id, '_wp_trash_meta_comments_status', true); if ( empty($statuses) || !is_array($statuses) ) return; foreach ( $statuses as $comment_id => $comment_status ){ if ( $comment_status == '1' ){ //if approved $container = blcContainerHelper::get_container(array($this->container_type, $comment_id)); $container->mark_as_unsynched(); } } } /** * Create or update synchronization records for all comments. * * @param bool $forced If true, assume that all synch. records are gone and will need to be recreated from scratch. * @return void */ function resynch($forced = false){ global $wpdb; /* @var wpdb $wpdb */ global $blclog; if ( $forced ){ //Create new synchronization records for all comments. $blclog->log('...... Creating synch. records for comments'); $start = microtime(true); $q = "INSERT INTO {$wpdb->prefix}blc_synch(container_id, container_type, synched) SELECT comment_ID, '{$this->container_type}', 0 FROM {$wpdb->comments} WHERE {$wpdb->comments}.comment_approved = '1'"; $wpdb->query( $q ); $blclog->log(sprintf('...... %d rows inserted in %.3f seconds', $wpdb->rows_affected, microtime(true) - $start)); } else { //Delete synch records corresponding to comments that no longer exist //or have been trashed/spammed/unapproved. $blclog->log('...... Deleting synch. records for removed comments'); $start = microtime(true); $q = "DELETE synch.* FROM {$wpdb->prefix}blc_synch AS synch LEFT JOIN {$wpdb->comments} AS comments ON comments.comment_ID = synch.container_id WHERE synch.container_type = '{$this->container_type}' AND (comments.comment_ID IS NULL OR comments.comment_approved <> '1')"; $wpdb->query( $q ); $blclog->log(sprintf('...... %d rows deleted in %.3f seconds', $wpdb->rows_affected, microtime(true) - $start)); //Create synch. records for comments that don't have them. $blclog->log('...... Creating synch. records for new comments'); $start = microtime(true); $q = "INSERT INTO {$wpdb->prefix}blc_synch(container_id, container_type, synched) SELECT comment_ID, '{$this->container_type}', 0 FROM {$wpdb->comments} AS comments LEFT JOIN {$wpdb->prefix}blc_synch AS synch ON (synch.container_id = comments.comment_ID and synch.container_type='{$this->container_type}') WHERE comments.comment_approved = '1' AND synch.container_id IS NULL"; $wpdb->query($q); $blclog->log(sprintf('...... %d rows inserted in %.3f seconds', $wpdb->rows_affected, microtime(true) - $start)); /* Note that there is no way to detect comments that were *edited* (not added - those will be caught by the above query) while the plugin was inactive. Unlike with posts, WP doesn't track comment modification times. */ } } /** * Get the message to display after $n comments have been deleted. * * @param int $n Number of deleted comments. * @return string A delete confirmation message, e.g. "5 comments were deleted" */ function ui_bulk_delete_message($n){ if ( EMPTY_TRASH_DAYS ){ return $this->ui_bulk_trash_message($n); } else { return sprintf( _n( "%d comment has been deleted.", "%d comments have been deleted.", $n, 'broken-link-checker' ), $n ); } } /** * Get the message to display after $n comments have been moved to the trash. * * @param int $n Number of trashed comments. * @return string A delete confirmation message, e.g. "5 comments were moved to trash" */ function ui_bulk_trash_message($n){ return sprintf( _n( "%d comment moved to the Trash.", "%d comments moved to the Trash.", $n, 'broken-link-checker' ), $n ); } /** * Instantiate multiple containers of the container type managed by this class. * * @param array $containers Array of assoc. arrays containing container data. * @param string $purpose An optional code indicating how the retrieved containers will be used. * @param bool $load_wrapped_objects Preload wrapped objects regardless of purpose. * * @return array of blcPostContainer indexed by "container_type|container_id" */ function get_containers($containers, $purpose = '', $load_wrapped_objects = false){ global $wpdb; /* @var wpdb $wpdb */ $containers = $this->make_containers($containers); //Preload comment data if it is likely to be useful later $preload = $load_wrapped_objects || in_array($purpose, array(BLC_FOR_DISPLAY, BLC_FOR_PARSING)); if ( $preload ){ $comment_ids = array(); foreach($containers as $container){ /* @var blcContainer $container */ $comment_ids[] = $container->container_id; } //There's no WP function for retrieving multiple comments by their IDs, //so we query the DB directly. $q = "SELECT * FROM {$wpdb->comments} WHERE comment_ID IN (" . implode(', ', $comment_ids) . ")"; $comments = $wpdb->get_results($q); foreach($comments as $comment){ //Cache the comment in the internal WP object cache $comment = get_comment($comment); /* @var StdClass $comment */ //Attach it to the container $key = $this->container_type . '|' . $comment->comment_ID; if ( isset($containers[$key]) ){ $containers[$key]->wrapped_object = $comment; } } } return $containers; } } Privacy Policy | Little Adventures Books

Privacy Policy

Little Adventures Privacy Policy


The purpose of this Privacy Policy is to describe how Little Adventures, and imprint of Amberjack Publishing Company, an Idaho corporation (“Little Adventures,” “us,” “we,” or “our”) collects, uses and shares information about you through our U.S. online interfaces (e.g., websites and mobile applications) owned and controlled by us, including www.littleadventuresbooks.com (collectively referred to herein as the “Site”). Please read this notice carefully to understand what we do. If you do not understand any aspects of our Privacy Policy, please feel free to contact us at hello@littleadventuresbooks.com. Your use of our Site is also governed by our Terms of Use.

What Information this Privacy Policy Covers

This Privacy Policy covers information we collect from you through our Site. Some of our Site’s functionality can be used without revealing any personal information, though for features or services related to any interactive portion of our website, personal information is required. If you do not use these specific features or services on the Site, then the only information we collect will be “Non-Personal Information” (i.e., information that cannot be used to identify you). Non-Personal Information includes information such as the web pages that you have viewed. In order to access certain features and benefits on our Site, you may need to submit “Personally Identifiable Information” (i.e., information that can be used to identify you). Personally Identifiable Information can include information such as your name and email address, among other things. You are responsible for ensuring the accuracy of the Personally Identifiable Information you submit to Little Adventures. Inaccurate information may affect your ability to use the Site, the information you receive when using the Site, and our ability to contact you. For example, your email address should be kept current because that is one of the primary manners in which we communicate with you.

What You Consent to by Using Our Site

Please understand that by submitting any Personally Identifiable Information to us, you consent and agree that we may collect, use and disclose such Personally Identifiable Information in accordance with this Privacy Policy and our Terms of Use, and as permitted or required by law. If you do not agree with these terms, then please do not provide any Personally Identifiable Information to us. If you refuse or withdraw your consent, or if you choose not to provide us with any required Personally Identifiable Information, we may not be able to provide you with the services that can be offered on our Site.

What Information We Collect

We gather two types of information about users through the Site:

Non-Personal Information. When users come to our Site, we may track, collect and aggregate Non-Personal Information indicating, among other things, which pages of our Site were visited, the order in which they were visited, when they were visited, and which hyperlinks were “clicked.” We also collect information from the URLs from which you linked to our Site. Collecting such information may involve logging the IP address, operating system and browser software used by each user of the Site. Although such information is not Personally Identifiable Information, we may be able to determine from an IP address a user’s Internet Service Provider and the geographic location of his or her point of connectivity.


We also use or may use cookies and/or web beacons to help us determine and identify repeat visitors, the type of content and sites to which a user of our Site links, the length of time each user spends at any particular area of our Site, and the specific functionalities that users choose to use. Essentially, cookies are a user’s identification card for the Little Adventures servers. Web beacons are small graphic files linked to our servers that allow us to track your use of our Site and related functionalities. Cookies and web beacons allow Little Adventures to serve you better and more efficiently, and to personalize your experience at our Site. Cookies and web beacons are not used to retain Personally Identifiable Information. From time to time we may also use additional typical methods of collecting data.

You should be able to control how and whether cookies will be accepted by your web browser. Most browsers offer instructions on how to reset the browser to reject cookies in the “Help” section of the toolbar. If you reject our cookies, many functions and conveniences of this Site may not work properly.

Personally Identifiable Information. We collect Personally Identifiable Information that you provide to us when you register for an account, update or change information for your account, complete a survey, sign-up for email updates, participate in our public forums, send us email messages, and/or participate other services on our Site. We may use the Personally Identifiable Information that you provide to respond to your questions, provide you the specific course and/or services you select, send you updates about services offered by Little Adventures or other Little Adventures events, and send you email messages about Site maintenance or updates.

Account Registration. If you register for an account on our Site, you may be required to provide us with Personally Identifiable Information such as your name and email address.

Updates. Little Adventures may offer you the ability to receive updates either via email or by posting on portions of the Site only accessible to registered users. In order to subscribe to these services, you may be required to provide us with Personally Identifiable Information such as your name and email address.

Forums. Little Adventures may offer public forums from time to time (the “Forums”) where you can share comments and thoughts. In order to participate in the Forums, you may be required to register with us and/or provide us with Personally Identifiable Information such as your name and email address. Personally Identifiable Information shall not include any information posted or sent by or to you via any public Forum. Please keep in mind that information you post or make available in Forums will be publicly available. Accordingly, you should be careful when posting any personal or sensitive information. Please also reference our Terms of Use for additional information about proper use of our Forums.

Communications with Little Adventures. We may receive Personally Identifiable Information when you send us an email message or otherwise contact us.

Third Party Sites. We may receive Personally Identifiable Information when you access or log-in to a third party site, e.g., Facebook, from our Sites. This may include the text and/or images of your Personally Identifiable Information available from the third party site.

Surveys. We may receive Personally Identifiable Information when you provide information in response to a survey operated by us.


How We Use the Information

Non-Personal Information. We use Non-Personal Information to build higher quality, more useful services by performing statistical analyses of the collective characteristics and behavior of our users, and by measuring demographics and interests regarding specific areas of our Site. We may also use it for other business purposes.

Personally Identifiable Information. Except as set forth in this Privacy Policy or as specifically agreed to by you, Little Adventures will not disclose any Personally Identifiable Information we gather from you on the Site. In addition to the other uses set forth in this Privacy Policy, we may disclose and otherwise use Personally Identifiable Information as described below. We may also use it for research and business purposes, including improving and customizing the Site and the products and services we offer.

Updates. We use Personally Identifiable Information collected when you sign-up for our various email or update services to send you the messages in connection with the Site. We may also archive this information and/or use it for future communications with you.

Forums. To facilitate your use of the Forums, we use Personally Identifiable Information collected during your use of the Forums. In addition, we may publish this information via extensions of our platform that use third-party services, like mobile applications. We also reserve the right to reuse Forum posts containing Personally Identifiable Information in future versions of the services we offer, and to enhance future offerings. We may archive this information and/or use it for future communications with you. We may also use or publish posts submitted on the Forums without using Personally Identification Information.

Communications with Little Adventures. When you send us an email message or otherwise contact us, we may use the information provided by you to respond to your communication and/or as described in this Privacy Policy. We may also archive this information and/or use it for future communications with you.

Disclosure to Little Adventures Operations and Maintenance Contractors. We use various service providers, vendors and contractors (collectively, “Contractors”) to assist us in providing our products and services to you. Our Contractors may have limited access to your Personally Identifiable Information in the course of providing their products or services to us, so that we in turn can provide our products and services to you. These Contractors may include vendors and suppliers that provide us with technology, services, and/or content related to the operation and maintenance of the Site or services. Access to your Personally Identifiable Information by these contractors is limited to the information reasonably necessary for the contractor to perform its limited function for us.

Government Authorities, Legal Rights and Actions. Little Adventures may share your Personally Identifiable Information with various government authorities in response to subpoenas, court orders, or other legal process; to establish or exercise our legal rights or to protect our property; to defend against legal claims; or as otherwise required by law. In such cases we reserve the right to raise or waive any legal objection or right available to us. We also may share your Personally Identifiable Information when we believe it is appropriate to investigate, prevent, or take action regarding illegal or suspected illegal activities; to protect and defend the rights, property, or safety of Little Adventures, the Site, our users, customers, or others; and in connection with our Terms of Use and other agreements.

Disclosure to Acquirers. Little Adventures may disclose and/or transfer your Personally Identifiable Information to an acquirer, assignee or other successor entity in connection with a sale, merger, or reorganization of all or substantially all of the equity, business or assets of Little Adventures to which your Personally Identifiable Information relates.

External Links

For your convenience we may provide links to sites operated by organizations other than Little Adventures (“Third Party Sites”) that we believe may be of interest to you. We do not disclose your Personally Identifiable Information to these Third Party Sites without obtaining your consent. We do not endorse and are not responsible for the privacy practices of these Third Party Sites. If you choose to click on a link to one of these Third Party Sites, you should review the privacy policy posted on the other site to understand how that Third Party Site collects and uses your Personally Identifiable Information.

Confidentiality & Security of Personally Identifiable Information

We consider the confidentiality and security of your information to be of the utmost importance. We will use industry standard physical, technical and administrative security measures to keep your Personally Identifiable Information confidential and secure and will not share it with third parties, except as otherwise provided in this Privacy Policy, or unless we have good faith belief that such disclosure is necessary in special cases, such as a physical threat to you or others. Because the Internet is not a 100% secure environment we cannot guarantee the security of Personally Identifiable Information, and there is some risk that an unauthorized third party may find a way to circumvent our security systems or that transmission of your information over the Internet will be intercepted. It is your responsibility to protect the security of your login information. Please note that e-mails and other communications you send to us through our Site are not encrypted.

Updating or Deleting Your Personally Identifiable Information

You can access your Personally Identifiable Information and confirm that it remains correct and up-to-date or choose whether or not you wish to receive material from us or some of our partners by logging into the Site and visiting your user account page. You may also contact us via hello@littleadventuresbooks.com. We try to answer every email promptly, but may not always be able to do so. Keep in mind, however, that there will be residual information that will remain within our databases, access logs and other records, which may or may not contain your Personally Identifiable Information.

If you have any privacy-related questions, unresolved problems, or complaints you may contact us via hello@littleadventuresbooks.com.

California Privacy Rights

Under California’s “Shine the Light” law, California residents who provide personal information in obtaining products or services for personal, family or household use are entitled to request and obtain from us once a calendar year information about the customer information we shared, if any, with other businesses for their own direct marketing uses. If applicable, this information would include the categories of customer information and the names and addresses of those businesses with which we shared customer information for the immediately prior calendar year (e.g. requests made in 2012 will receive information regarding 2011 sharing activities).

To obtain this information, please send an email message to hello@littleadventuresbooks.com with “Request for California Privacy Information” on the subject line and in the body of your message. We will provide the requested information to you at your e-mail address in response. Please be aware that not all information sharing is covered by the “Shine the Light” requirements and only information on covered sharing will be included in our response.

International Privacy Practices

Little Adventures websites, including websites directed to residents in countries and jurisdictions outside of the United States, are operated and managed on servers located and operated within the United States. By using and accessing our Sites, residents and citizens of countries and jurisdictions outside of the United States agree and consent to the transfer to and processing of personal information on servers located in the United States, and that the protection of such information may be different than required under the laws of your residence or location.

Changing Our Privacy Policy

Please note that we review our privacy practices from time to time, and that these practices are subject to change. Any change, update, or modification will be effective immediately upon posting on our Site. We will notify you of any material change to this Privacy Policy by posting a notice on our Site’s homepage for a reasonable period of time following such update, and by changing the effective date (located at the bottom of this page). Be sure to return to this page periodically to ensure familiarity with the most current version of this Privacy Policy.

No Information from Children Under 13

Little Adventures strongly believes in protecting the privacy of children. In line with this belief, we do not knowingly collect or maintain Personally Identifiable Information on our Site from persons under 13 years of age, and no part of our Site is directed to persons under 13 years of age. If you are under 13 years of age, then please do not use or access this Site at any time or in any manner. We will take appropriate steps to delete any Personally Identifiable Information of persons less than 13 years of age that has been collected on our Site without verified parental consent upon learning of the existence of such Personally Identifiable Information.


This Privacy Policy is effective March 30, 2015.

All Rights Reserved by Little Adventures | © 2015-2016