Options configuration panel Version: 1.1.1 Author: Fernando Torros Author URI: http://cybec.com */ /* To install: 1. Upload privacy-policy.zip to the /wp-content/plugins/ directory for your blog. 2. Unzip it into /wp-content/plugins/privacy-policy/privacy-policy.php 3. Activate the plugin through the 'Plugins' menu in WordPress by clicking "Privacy Policy" 4. Go to your Options Panel and open the "Privacy Policy" submenu. /wp-admin/options-general.php?page=privacy-policy.php 5. Configure the privacy policy options you want. License: Copyright by Fernando Torros. You are free to use this plugin on any WordPress blog. No warranty is provided -- it's up to you to ensure that the privacy policy it generates is good enough for your site and/or jurisdiction. */ $privacy_policy_ver = '1.1'; $pp_default_sitename = get_bloginfo( 'name' ); $pp_default_before_heading = '
'; $pp_default_after_paragraph = '
'; $pp_default_contact = get_bloginfo( 'admin_email' ); $pp_default_title = 'AdSense Privacy Policy'; $pp_default_slug = 'privacy-policy'; $pp_default_pp_help = true; $pp_default_browser_help = true; $pp_default_credit = true; add_option( 'privacy_policy_sitename', $pp_default_sitename ); add_option( 'privacy_policy_before_heading', $pp_default_before_heading ); add_option( 'privacy_policy_after_heading', $pp_default_after_heading ); add_option( 'privacy_policy_before_paragraph', $pp_default_before_paragraph ); add_option( 'privacy_policy_after_paragraph', $pp_default_after_paragraph ); add_option( 'privacy_policy_contact', $pp_default_contact ); add_option( 'privacy_policy_title', $pp_default_title ); add_option( 'privacy_policy_slug', $pp_default_slug ); add_option( 'privacy_policy_pp_help', $pp_default_pp_help ); add_option( 'privacy_policy_browser_help', $pp_default_browser_help ); add_option( 'privacy_policy_credit', $pp_default_credit ); function privacy_policy_options_setup() { if( function_exists( 'add_options_page' ) ){ add_options_page( 'Adsense Privacy Policy', 'Adsense Privacy Policy', 8, basename(__FILE__), 'privacy_policy_options_page'); } } function privacy_policy_options_page(){ global $privacy_policy_ver; global $pp_default_sitename; global $pp_default_before_heading; global $pp_default_after_heading; global $pp_default_before_paragraph; global $pp_default_after_paragraph; global $pp_default_contact; global $pp_default_title; global $pp_default_slug; global $pp_default_pp_help; global $pp_default_browser_help; global $pp_default_credit; if( isset( $_POST[ 'set_defaults' ] ) ){ echo ''; update_option( 'privacy_policy_sitename', $pp_default_sitename ); update_option( 'privacy_policy_before_heading', $pp_default_before_heading ); update_option( 'privacy_policy_after_heading', $pp_default_after_heading ); update_option( 'privacy_policy_before_paragraph', $pp_default_before_paragraph ); update_option( 'privacy_policy_after_paragraph', $pp_default_after_paragraph ); update_option( 'privacy_policy_contact', $pp_default_contact ); update_option( 'privacy_policy_title', $pp_default_title ); update_option( 'privacy_policy_slug', $pp_default_slug ); update_option( 'privacy_policy_pp_help', $pp_default_pp_help ); update_option( 'privacy_policy_browser_help', $pp_default_browser_help ); update_option( 'privacy_policy_credit', $pp_default_credit ); echo 'Default Privacy Policy options loaded!'; echo '
'; $title = stripslashes( (string) $_POST[ 'privacy_policy_title' ] ); $slug = stripslashes( (string) $_POST[ 'privacy_policy_slug' ] ); update_option( 'privacy_policy_title', $title ); update_option( 'privacy_policy_slug', $slug ); $post_title = $title; $post_content = ''; $post_status = 'publish'; $post_author = 1; $post_name = $slug; $post_type = 'page'; $post_data = compact( 'post_title', 'post_content', 'post_status', 'post_author', 'post_name', 'post_type' ); $postID = wp_insert_post( $post_data ); if( !$postID ){ echo 'Privacy policy page could not be created'; } else { echo 'Privacy policy page (ID ' . $postID . ') was created'; } echo '
'; update_option( 'privacy_policy_sitename', stripslashes( (string) $_POST['privacy_policy_sitename' ] )); update_option( 'privacy_policy_before_heading', stripslashes( (string) $_POST['privacy_policy_before_heading' ] )); update_option( 'privacy_policy_after_heading', stripslashes( (string) $_POST['privacy_policy_after_heading' ] )); update_option( 'privacy_policy_before_paragraph', stripslashes( (string) $_POST['privacy_policy_before_paragraph' ] )); update_option( 'privacy_policy_after_paragraph', stripslashes( (string) $_POST['privacy_policy_after_paragraph' ] )); update_option( 'privacy_policy_contact', stripslashes( (string) $_POST['privacy_policy_contact' ] )); update_option( 'privacy_policy_title', stripslashes( (string) $_POST['privacy_policy_title' ] )); update_option( 'privacy_policy_slug', stripslashes( (string) $_POST['privacy_policy_slug' ] )); update_option( 'privacy_policy_pp_help', (bool) $_POST['privacy_policy_pp_help'] ); update_option( 'privacy_policy_browser_help', (bool) $_POST['privacy_policy_browser_help'] ); update_option( 'privacy_policy_credit', (bool) $_POST['privacy_policy_credit'] ); echo 'Configuration updated!'; echo '
The AdSense Privacy Policy Plugin for WordPress automatically generates a privacy policy for your blog that is compliant with the AdSense terms and conditions. The policy is also general enough to be used even if you're not displaying AdSense ads.
To use the plugin, insert the trigger text <!-- privacy-policy --> into an existing page. The trigger will be automatically replaced with a complete privacy policy.
For your convenience, the plugin can also create a new privacy page for you. Simply fill in the title and slug (path) details and press the "Create Page" button to create the privacy page. The trigger text will be added automatically to the new page.