initial commit

master
Walter Lapchynski 8 years ago
commit 9a3748aa8e

@ -0,0 +1,20 @@
jQuery(document).ready(function($) {
jQuery( '#select404page' ).change(function() {
jQuery( '#edit_404_page, #test_404_page' ).prop( 'disabled', !( jQuery( '#select404page' ).val() == jQuery( '#404page_current_value').text() != 0 ) );
});
jQuery( '#select404page' ).trigger( 'change' );
jQuery( '#edit_404_page' ).click(function() {
window.location.href = jQuery( '#404page_edit_link' ).text();
});
jQuery( '#test_404_page' ).click(function() {
window.location.href = jQuery( '#404page_test_link' ).text();
});
jQuery( '#404page_admin_notice .notice-dismiss' ).click( function() {
jQuery.ajax({
url: ajaxurl,
data: {
action: '404page_dismiss_admin_notice'
}
});
});
});

@ -0,0 +1,641 @@
<?php
/*
Plugin Name: 404page - your smart custom 404 error page
Plugin URI: http://petersplugins.com/free-wordpress-plugins/404page/
Description: Custom 404 the easy way! Set any page as custom 404 error page. No coding needed. Works with (almost) every Theme.
Version: 2.3
Author: Peter's Plugins, smartware.cc
Author URI: http://petersplugins.com
Text Domain: 404page
License: GPL2+
License URI: http://www.gnu.org/licenses/gpl-2.0.txt
*/
if ( ! defined( 'WPINC' ) ) {
die;
}
define( 'PP_404', true );
class Smart404Page {
public $plugin_name;
public $plugin_slug;
public $version;
private $wp_url;
private $my_url;
private $dc_url;
public $settings;
private $template;
private $postid;
public function __construct() {
$this->plugin_name = '404page';
$this->plugin_slug = '404page';
$this->version = '2.3';
$this->get_settings();
$this->init();
}
// get all settings
private function get_settings() {
$this->settings = array();
$this->settings['404page_page_id'] = $this->get_404page_id();
$this->settings['404page_hide'] = $this->get_404page_hide();
$this->settings['404page_fire_error'] = $this->get_404page_fire_error();
// $this->settings['404page_method'] = $this->get_404page_method(); --> moved to set_mode in v 2.2 because this may be too early here
$this->settings['404page_native'] = false;
}
// do plugin init
private function init() {
// as of v 2.2 always call set_mode
add_action( 'init', array( $this, 'set_mode' ) );
if ( !is_admin() ) {
add_action( 'pre_get_posts', array ( $this, 'exclude_404page' ) );
add_filter( 'get_pages', array ( $this, 'remove_404page_from_array' ), 10, 2 );
} else {
add_action( 'admin_init', array( $this, 'admin_init' ) );
add_action( 'admin_menu', array( $this, 'admin_menu' ) );
add_action( 'admin_head', array( $this, 'admin_css' ) );
add_filter( 'plugin_action_links_' . plugin_basename( __FILE__ ), array( $this, 'add_settings_link' ) );
if ( $this->settings['404page_hide'] and $this->settings['404page_page_id'] > 0 ) {
add_action( 'pre_get_posts' ,array ( $this, 'exclude_404page' ) );
}
}
}
// init filters
function set_mode() {
$this->settings['404page_method'] = $this->get_404page_method();
if ( !is_admin() ) {
if ( defined( 'CUSTOMIZR_VER' ) ) {
// Customizr Compatibility Mode
add_filter( 'tc_404_header_content', array( $this, 'show404title_customizr_mode' ), 999 );
add_filter( 'tc_404_content', array( $this, 'show404_customizr_mode' ), 999 );
add_filter( 'tc_404_selectors', array( $this, 'show404articleselectors_customizr_mode' ), 999 );
} elseif ( $this->settings['404page_method'] != 'STD' ) {
// Compatibility Mode
add_filter( 'posts_results', array( $this, 'show404_compatiblity_mode' ), 999 );
} else {
// Standard Mode
add_filter( '404_template', array( $this, 'show404_standard_mode' ), 999 );
if ( $this->settings['404page_fire_error'] ) {
add_action( 'template_redirect', array( $this, 'do_404_header_standard_mode' ) );
}
}
}
}
// show 404 page - Standard Mode
function show404_standard_mode( $template ) {
global $wp_query;
$pageid = $this->settings['404page_page_id'];
if ( $pageid > 0 ) {
if ( ! $this->settings['404page_native'] ) {
$wp_query = null;
$wp_query = new WP_Query();
$wp_query->query( 'page_id=' . $pageid );
$wp_query->the_post();
$template = get_page_template();
rewind_posts();
add_filter( 'body_class', array( $this, 'add_404_body_class' ) );
}
$this->do_404page_action();
}
return $template;
}
// show 404 page - Compatibility Mode
function show404_compatiblity_mode( $posts ) {
// remove the filter so we handle only the first query - no custom queries
remove_filter( 'posts_results', array( $this, 'show404_compatiblity_mode' ), 999 );
$pageid = $this->settings['404page_page_id'];
if ( $pageid > 0 && ! $this->settings['404page_native'] ) {
if ( empty( $posts ) && is_main_query() && !is_robots() && !is_home() && !is_feed() && !is_search() && !is_archive() && ( !defined('DOING_AJAX') || !DOING_AJAX ) ) {
// we need to get the 404 page
$pageid = $this->get_page_id( $pageid );
// as of v2.1 we do not alter the posts argument here because this does not work with SiteOrigin's Page Builder Plugin, template_include filter introduced
$this->postid = $pageid;
$this->template = get_page_template_slug( $pageid );
if ( $this->template == '' ) {
$this->template = get_page_template();
}
add_action( 'wp', array( $this, 'do_404_header' ) );
add_filter( 'body_class', array( $this, 'add_404_body_class' ) );
add_filter( 'template_include', array( $this, 'change_404_template' ), 999 );
$posts[] = get_post( $pageid );
$this->do_404page_action();
} elseif ( 1 == count( $posts ) && 'page' == $posts[0]->post_type ) {
// Do a 404 if the 404 page is opened directly
if ( $this->settings['404page_fire_error'] ) {
$curpageid = $posts[0]->ID;
if ( defined( 'ICL_SITEPRESS_VERSION' ) ) {
// WPML is active - get the post ID of the default language
global $sitepress;
$curpageid = apply_filters( 'wpml_object_id', $curpageid, 'page', $sitepress->get_default_language() );
$pageid = apply_filters( 'wpml_object_id', $pageid, 'page', $sitepress->get_default_language() );
} elseif ( defined( 'POLYLANG_VERSION' ) ) {
// Polylang is active - get the post ID of the default language
$curpageid = pll_get_post( $curpageid, pll_default_language() );
$pageid = pll_get_post( $pageid, pll_default_language() );
}
if ( $pageid == $curpageid ) {
add_action( 'wp', array( $this, 'do_404_header' ) );
add_filter( 'body_class', array( $this, 'add_404_body_class' ) );
$this->do_404page_action();
}
}
}
} elseif ( $pageid > 0 && $this->settings['404page_native'] ) {
$this->do_404page_action();
}
return $posts;
}
// this function overrides the page template in compatibilty mode
function change_404_template( $template ) {
// we have to check if the template file is there because if the theme was changed maybe a wrong template is stored in the database
$new_template = locate_template( array( $this->template ) );
if ( '' != $new_template ) {
return $new_template ;
}
return $template;
}
// send a 404 HTTP header - Standard Mode
function do_404_header_standard_mode() {
if ( is_page() && get_the_ID() == $this->settings['404page_page_id'] && !is_404() ) {
status_header( 404 );
nocache_headers();
$this->do_404page_action();
}
}
// send a 404 HTTP header - Compatibility Mode
function do_404_header() {
// remove the action so we handle only the first query - no custom queries
remove_action( 'wp', array( $this, 'do_404_header' ) );
status_header( 404 );
nocache_headers();
}
// adds the error404 class to the body classes
function add_404_body_class( $classes ) {
$classes[] = 'error404';
return $classes;
}
// show title - Customizr Compatibility Mode
function show404title_customizr_mode( $title ) {
if ( ! $this->settings['404page_native'] ) {
return '<h1 class="entry-title">' . get_the_title( $this->settings['404page_page_id'] ) . '</h1>';
} else {
return $title;
}
}
// show content - Customizr Compatibility Mode
function show404_customizr_mode( $content ) {
if ( ! $this->settings['404page_native'] ) {
return '<div class="entry-content">' . apply_filters( 'the_content', get_post_field( 'post_content', $this->settings['404page_page_id'] ) ) . '</div>';
} else {
return $content;
}
$this->do_404page_action();
}
// change article selectors - Customizr Compatibility Mode
function show404articleselectors_customizr_mode( $selectors ) {
if ( ! $this->settings['404page_native'] ) {
return 'id="post-' . $this->settings['404page_page_id'] . '" ' . 'class="' . join( ' ', get_post_class( 'row-fluid', $this->settings['404page_page_id'] ) ) . '"';
} else {
return $selectors;
}
}
// init the admin section
function admin_init() {
$this->wp_url = 'https://wordpress.org/plugins/' . $this->plugin_slug;
$this->my_url = 'http://petersplugins.com/free-wordpress-plugins/' . $this->plugin_slug;
$this->dc_url = 'http://petersplugins.com/docs/' . $this->plugin_slug;
load_plugin_textdomain( '404page' );
add_settings_section( '404page-settings', null, null, '404page_settings_section' );
register_setting( '404page_settings', '404page_page_id' );
register_setting( '404page_settings', '404page_hide' );
register_setting( '404page_settings', '404page_method' );
register_setting( '404page_settings', '404page_fire_error' );
add_settings_field( '404page_settings_404page', __( 'Page to be displayed as 404 page', '404page' ) . '&nbsp;<a class="dashicons dashicons-editor-help" href="' . $this->dc_url . '/#settings_select_page"></a>' , array( $this, 'admin_404page' ), '404page_settings_section', '404page-settings', array( 'label_for' => '404page_page_id' ) );
add_settings_field( '404page_settings_hide', __( 'Hide 404 page', '404page' ) . '&nbsp;<a class="dashicons dashicons-editor-help" href="' . $this->dc_url . '/#settings_hide_page"></a>' , array( $this, 'admin_hide' ), '404page_settings_section', '404page-settings', array( 'label_for' => '404page_hide' ) );
add_settings_field( '404page_settings_fire', __( 'Fire 404 error', '404page' ) . '&nbsp;<a class="dashicons dashicons-editor-help" href="' . $this->dc_url . '/#settings_fire_404"></a>' , array( $this, 'admin_fire404' ), '404page_settings_section', '404page-settings', array( 'label_for' => '404page_fire_error' ) );
add_settings_field( '404page_settings_method', __( 'Operating Method', '404page' ) . '&nbsp;<a class="dashicons dashicons-editor-help" href="' . $this->dc_url . '/#settings_operating_method"></a>' , array( $this, 'admin_method' ), '404page_settings_section', '404page-settings', array( 'label_for' => '404page_method' ) );
}
// add css
function admin_css() {
echo '<style type="text/css">#select404page {width: 100%; }';
if ( $this->settings['404page_page_id'] > 0 ) {
echo ' #the-list #post-' . $this->settings['404page_page_id'] . ' .column-title {min-height: 32px; background-position: left top; background-repeat: no-repeat; background-image: url(' . plugins_url( 'pluginicon.png', __FILE__ ) . '); padding-left: 40px;}';
}
echo '</style>';
}
// handle the settings field page id
function admin_404page() {
if ( $this->settings['404page_page_id'] < 0 ) {
echo '<div class="error form-invalid" style="line-height: 3em">' . __( 'The page you have selected as 404 page does not exist anymore. Please choose another page.', '404page' ) . '</div>';
}
wp_dropdown_pages( array( 'name' => '404page_page_id', 'id' => 'select404page', 'echo' => 1, 'show_option_none' => __( '&mdash; NONE (WP default 404 page) &mdash;', '404page'), 'option_none_value' => '0', 'selected' => $this->settings['404page_page_id'] ) );
echo '<div id="404page_edit_link" style="display: none">' . get_edit_post_link( $this->get_404page_id() ) . '</div>';
echo '<div id="404page_test_link" style="display: none">' . get_site_url() . '/' . md5( rand() ) . '/' . md5( rand() ) . '/' . md5( rand() ) . '</div>';
echo '<div id="404page_current_value" style="display: none">' . $this->get_404page_id() . '</div>';
echo '<p class="submit"><input type="button" name="edit_404_page" id="edit_404_page" class="button secondary" value="' . __( 'Edit Page', '404page' ) . '" />&nbsp;<input type="button" name="test_404_page" id="test_404_page" class="button secondary" value="' . __( 'Test 404 error', '404page' ) . '" /></p>';
}
// handle the settings field hide
function admin_hide() {
echo '<p><input type="checkbox" id="404page_hide" name="404page_hide" value="1"' . checked( true, $this->settings['404page_hide'], false ) . '/>';
echo '<label for="404page_hide">' . __( 'Hide the selected page from the Pages list', '404page' ) . '</label></p>';
echo '<p><span class="dashicons dashicons-info"></span>&nbsp;' . __( 'For Administrators the page is always visible.', '404page' ) . '</p>';
}
// handle the settings field fire 404 error
function admin_fire404() {
echo '<p><input type="checkbox" id="404page_fire_error" name="404page_fire_error" value="1"' . checked( true, $this->settings['404page_fire_error'], false ) . '/>';
echo '<label for="404page_fire_error">' . __( 'Send an 404 error if the page is accessed directly by its URL', '404page' ) . '</label></p>';
echo '<p><span class="dashicons dashicons-info"></span>&nbsp;' . __( 'Uncheck this if you want the selected page to be accessible.', '404page' ) . '</p>';
if ( function_exists( 'wpsupercache_activate' ) ) {
echo '<p><span class="dashicons dashicons-warning"></span>&nbsp;<strong>' . __( 'WP Super Cache Plugin detected', '404page' ) . '</strong>. ' . __ ( 'If the page you selected as 404 error page is in cache, always a HTTP code 200 is sent. To avoid this and send a HTTP code 404 you have to exlcude this page from caching', '404page' ) . ' (<a href="' . admin_url( 'options-general.php?page=wpsupercache&tab=settings#rejecturi' ) . '">' . __( 'Click here', '404page' ) . '</a>).<br />(<a href="' . $this->dc_url . '/#wp_super_cache">' . __( 'Read more', '404page' ) . '</a>)</p>';
}
}
// handle the settings field method
function admin_method() {
if ( $this->settings['404page_native'] ) {
echo '<p><span class="dashicons dashicons-info"></span>&nbsp;' . __( 'This setting is not available because the Theme you are using natively supports the 404page plugin.', '404page' ) . ' (<a href="' . $this->dc_url . '/#native_mode">' . __( 'Read more', '404page' ) . '</a>)</p>';
} elseif ( defined( 'CUSTOMIZR_VER' ) ) {
echo '<p><span class="dashicons dashicons-info"></span>&nbsp;' . __( 'This setting is not availbe because the 404page Plugin works in Customizr Compatibility Mode.', '404page' ) . ' (<a href="' . $this->dc_url . '/#special_modes">' . __( 'Read more', '404page' ) . '</a>)</p>';
} elseif ( defined( 'ICL_SITEPRESS_VERSION' ) ) {
echo '<p><span class="dashicons dashicons-info"></span>&nbsp;' . __( 'This setting is not availbe because the 404page Plugin works in WPML Mode.', '404page' ) . ' (<a href="' . $this->dc_url . '/#special_modes">' . __( 'Read more', '404page' ) . '</a>)</p>';
} elseif ( defined( 'POLYLANG_VERSION' ) ) {
echo '<p><span class="dashicons dashicons-info"></span>&nbsp;' . __( 'This setting is not availbe because the 404page Plugin works in Polylang Mode.', '404page' ) . ' (<a href="' . $this->dc_url . '/#special_modes">' . __( 'Read more', '404page' ) . '</a>)</p>';
} else {
echo '<p><input type="radio" id="404page_settings_method_standard" name="404page_method" value="STD"' . checked( 'STD', $this->settings['404page_method'], false ) . ' />';
echo '<label for="404page_settings_method_standard">' . __( 'Standard Mode', '404page' ) . '</label></p>';
echo '<p><input type="radio" id="404page_settings_method_compatibility" name="404page_method" value="CMP"' . checked( 'CMP', $this->settings['404page_method'], false ) . '/>';
echo '<label for="404page_settings_method_compatibility">' . __( 'Compatibility Mode', '404page' ) . '</label></p>';
echo '<p><span class="dashicons dashicons-info"></span>&nbsp;' . __( 'Standard Mode uses the WordPress Template System and should work in most cases. If the 404page plugin does not work properly, probably you are using a theme or plugin that modifies the WordPress Template System. In this case the Compatibility Mode maybe can fix the problem, although it cannot be guaranteed that every possible configuration can be handled by Compatibility Mode. Standard Mode is the recommended method, only switch to Compatibility Mode if you have any problems.', '404page' ) . '</p>';
}
}
// this function hides the selected page from the list of pages
function exclude_404page( $query ) {
if ( $this->settings['404page_page_id'] > 0 ) {
global $pagenow;
$post_type = $query->get( 'post_type' );
// as of v 2.3 we check the post_type on front end
if( ( is_admin() && ( 'edit.php' == $pagenow && !current_user_can( 'create_users' ) ) ) || ( ! is_admin() && ( !empty( $post_type) && ( ('page' === $post_type || 'any' === $post_type) || ( is_array( $post_type ) && in_array( 'page', $post_type ) ) ) )) ) {
$pageid = $this->settings['404page_page_id'];
if ( ! is_admin() ) {
$pageid = $this->get_page_id( $pageid );
}
// as of v 2.3 we add the ID of the 404 page to post__not_in
// using just $query->set() overrides existing settings but not adds a new setting
$query->set( 'post__not_in', array_merge( (array)$query->get( 'post__not_in', array() ), array( $pageid ) ) );
}
}
}
// this function removes the 404 page from get_pages result array
function remove_404page_from_array( $pages, $r ) {
if ( $this->settings['404page_page_id'] > 0 ) {
$pageid = $this->get_page_id( $this->settings['404page_page_id'] );
for ( $i = 0; $i < sizeof( $pages ); $i++ ) {
if ( $pages[$i]->ID == $pageid ) {
unset( $pages[$i] );
break;
}
}
}
return array_values( $pages );
}
// adds the options page to admin menu
function admin_menu() {
$page_handle = add_theme_page ( __( '404 Error Page', "404page" ), __( '404 Error Page', '404page' ), 'manage_options', '404pagesettings', array( $this, 'admin_page' ) );
add_action( 'admin_print_scripts', array( $this, 'admin_js' ) );
}
// adds javascript to the 404page settings page
function admin_js() {
wp_enqueue_script( '404pagejs', plugins_url( '/404page.js', __FILE__ ), 'jquery', $this->version, true );
}
// creates the options page
function admin_page() {
if ( !current_user_can( 'manage_options' ) ) {
wp_die( __( 'You do not have sufficient permissions to access this page.' ) );
}
?>
<div class="wrap">
<?php screen_icon(); ?>
<h2 style="min-height: 32px; line-height: 32px; padding-left: 40px; background-image: url(<?php echo plugins_url( 'pluginicon.png', __FILE__ ); ?>); background-repeat: no-repeat; background-position: left center"><a href="<?php echo $this->my_url; ?>">404page</a> <?php echo __( 'Settings', '404page' ); ?></h2>
<?php settings_errors(); ?>
<hr />
<p>Plugin Version: <?php echo $this->version; ?> <a class="dashicons dashicons-editor-help" href="<?php echo $this->wp_url; ?>/changelog/"></a></p>
<div id="poststuff">
<div id="post-body" class="metabox-holder columns-2">
<div id="post-body-content">
<div class="meta-box-sortables ui-sortable">
<form method="post" action="options.php">
<div class="postbox">
<div class="inside">
<?php
settings_fields( '404page_settings' );
do_settings_sections( '404page_settings_section' );
submit_button();
?>
</div>
</div>
</form>
</div>
</div>
<?php { $this->show_meta_boxes(); } ?>
</div>
<br class="clear">
</div>
</div>
<?php
}
// returns the id of the 404 page if one is defined, returns 0 if none is defined, returns -1 if the defined page id does not exist
private function get_404page_id() {
$pageid = get_option( '404page_page_id', 0 );
if ( $pageid != 0 ) {
$page = get_post( $pageid );
if ( !$page || $page->post_status != 'publish' ) {
$pageid = -1;
}
}
return $pageid;
}
// returns the selected method
private function get_404page_method() {
if ( defined( 'ICL_SITEPRESS_VERSION' ) || defined( 'POLYLANG_VERSION' ) ) {
// WPML or Polylang is active
return 'CMP';
} else {
return get_option( '404page_method', 'STD' );
}
}
// should we hide the selected 404 page from the page list?
private function get_404page_hide() {
return (bool)get_option( '404page_hide', false );
}
// should we fire an 404 error if the selected page is accessed directly?
private function get_404page_fire_error() {
return (bool)get_option( '404page_fire_error', true );
}
// this function gets the id of the translated page if WPML or Polylang is active - otherwise the original pageid is returned
private function get_page_id( $pageid ) {
if ( defined( 'ICL_SITEPRESS_VERSION' ) ) {
// WPML is active
$pageid = apply_filters( 'wpml_object_id', $pageid, 'page', true );
} elseif ( defined( 'POLYLANG_VERSION' ) ) {
// Polylang is active
$translatedpageid = pll_get_post( $pageid );
if ( !empty( $translatedpageid ) && 'publish' == get_post_status( $translatedpageid ) ) {
$pageid = $translatedpageid;
}
}
return $pageid;
}
// make plugin expandable
function do_404page_action() {
do_action( '404page_after_404' );
}
// show meta boxes
function show_meta_boxes() {
?>
<div id="postbox-container-1" class="postbox-container">
<div class="meta-box-sortables">
<div class="postbox">
<h3><span><?php _e( 'Like this Plugin?', '404page' ); ?></span></h3>
<div class="inside">
<ul>
<li><div class="dashicons dashicons-wordpress"></div>&nbsp;&nbsp;<a href="<?php echo $this->wp_url; ?>/"><?php _e( 'Please rate the plugin', '404page' ); ?></a></li>
<li><div class="dashicons dashicons-admin-home"></div>&nbsp;&nbsp;<a href="<?php echo $this->my_url; ?>/"><?php _e( 'Plugin homepage', '404page'); ?></a></li>
<li><div class="dashicons dashicons-admin-home"></div>&nbsp;&nbsp;<a href="http://petersplugins.com/"><?php _e( 'Author homepage', '404page' );?></a></li>
<li><div class="dashicons dashicons-googleplus"></div>&nbsp;&nbsp;<a href="http://g.petersplugins.com/"><?php _e( 'Authors Google+ Page', '404page' ); ?></a></li>
<li><div class="dashicons dashicons-facebook-alt"></div>&nbsp;&nbsp;<a href="http://f.petersplugins.com/"><?php _e( 'Authors facebook Page', '404page' ); ?></a></li>
</ul>
</div>
</div>
<div class="postbox">
<h3><span><?php _e( 'Need help?', '404page' ); ?></span></h3>
<div class="inside">
<ul>
<li><div class="dashicons dashicons-book-alt"></div>&nbsp;&nbsp;<a href="<?php echo $this->dc_url; ?>"><?php _e( 'Take a look at the Plugin Doc', '404page' ); ?></a></li>
<li><div class="dashicons dashicons-wordpress"></div>&nbsp;&nbsp;<a href="<?php echo $this->wp_url; ?>/faq/"><?php _e( 'Take a look at the FAQ section', '404page' ); ?></a></li>
<li><div class="dashicons dashicons-wordpress"></div>&nbsp;&nbsp;<a href="http://wordpress.org/support/plugin/<?php echo $this->plugin_slug; ?>/"><?php _e( 'Take a look at the Support section', '404page'); ?></a></li>
<li><div class="dashicons dashicons-admin-comments"></div>&nbsp;&nbsp;<a href="http://petersplugins.com/contact/"><?php _e( 'Feel free to contact the Author', '404page' ); ?></a></li>
</ul>
</div>
</div>
<div class="postbox">
<h3><span><?php _e( 'Translate this Plugin', '404page' ); ?></span></h3>
<div class="inside">
<p><?php _e( 'It would be great if you\'d support the 404page Plugin by adding a new translation or keeping an existing one up to date!', '404page' ); ?></p>
<p><a href="https://translate.wordpress.org/projects/wp-plugins/<?php echo $this->plugin_slug; ?>"><?php _e( 'Translate online', '404page' ); ?></a></p>
</div>
</div>
</div>
</div>
<?php
}
// add a link to settings page in plugin list
function add_settings_link( $links ) {
return array_merge( $links, array( '<a href="' . admin_url( 'themes.php?page=404pagesettings' ) . '">' . __( 'Settings', '404page' ) . '</a>') );
}
// uninstall plugin
function uninstall() {
if( is_multisite() ) {
$this->uninstall_network();
} else {
$this->uninstall_single();
}
}
// uninstall network wide
function uninstall_network() {
global $wpdb;
$activeblog = $wpdb->blogid;
$blogids = $wpdb->get_col( esc_sql( 'SELECT blog_id FROM ' . $wpdb->blogs ) );
foreach ($blogids as $blogid) {
switch_to_blog( $blogid );
$this->uninstall_single();
}
switch_to_blog( $activeblog );
}
// uninstall single blog
function uninstall_single() {
foreach ( $this->settings as $key => $value) {
delete_option( $key );
}
}
// *
// * functions for theme usage
// *
// check if there's a custom 404 page set
function pp_404_is_active() {
return ( $this->settings['404page_page_id'] > 0 );
}
// activate the native theme support
function pp_404_set_native_support() {
$this->settings['404page_native'] = true;
}
// get the title - native theme support
function pp_404_get_the_title() {
$title = '';
if ( $this->settings['404page_page_id'] > 0 && $this->settings['404page_native'] ) {
$title = get_the_title( $this->settings['404page_page_id'] );
}
return $title;
}
// print title - native theme support
function pp_404_the_title() {
echo $this->pp_404_get_the_title();
}
// get the content - native theme support
function pp_404_get_the_content() {
$content = '';
if ( $this->settings['404page_page_id'] > 0 && $this->settings['404page_native'] ) {
$content = apply_filters( 'the_content', get_post_field( 'post_content', $this->settings['404page_page_id'] ) );
}
return $content;
}
// print content - native theme support
function pp_404_the_content() {
echo $this->pp_404_get_the_content();
}
}
$smart404page = new Smart404Page();
// this function can be used by a theme to check if there's an active custom 404 page
function pp_404_is_active() {
global $smart404page;
return $smart404page->pp_404_is_active();
}
// this function can be used by a theme to activate native support
function pp_404_set_native_support() {
global $smart404page;
$smart404page->pp_404_set_native_support();
}
// this function can be used by a theme to get the title of the custom 404 page in native support
function pp_404_get_the_title() {
global $smart404page;
return $smart404page->pp_404_get_the_title();
}
// this function can be used by a theme to print out the title of the custom 404 page in native support
function pp_404_the_title() {
global $smart404page;
$smart404page->pp_404_the_title();
}
// this function can be used by a theme to get the content of the custom 404 page in native support
function pp_404_get_the_content() {
global $smart404page;
return $smart404page->pp_404_get_the_content();
}
// this function can be used by a theme to print out the content of the custom 404 page in native support
function pp_404_the_content() {
global $smart404page;
return $smart404page->pp_404_the_content();
}
?>

Binary file not shown.

After

Width:  |  Height:  |  Size: 934 B

@ -0,0 +1,197 @@
=== 404page - your smart custom 404 error page ===
Contributors: petersplugins, smartware.cc
Donate link:http://petersplugins.com/make-a-donation/
Tags: page, 404, error, error page, 404 page, page not found, page not found error, 404 error page, missing, broken link, template, 404 link, seo, custom 404, custom 404 page, custom 404 error, custom 404 error page, customize 404, customize 404 page, customize 404 error page
Requires at least: 3.0
Tested up to: 4.6
Stable tag: 2.3
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Custom 404 the easy way! Set any page as custom 404 error page. No coding needed. Works with (almost) every Theme.
== Description ==
> Create your custom 404 Error Page using the full Power of WordPress
**See also [Plugin Homepage](http://petersplugins.com/free-wordpress-plugins/404page/) and [Plugin Doc](http://petersplugins.com/docs/404page/)**
https://www.youtube.com/watch?v=VTL07Lf0IsY
Create your custom 404 Page as a normal WordPress Page using the full power of WordPress. You can use a Custom Page Template or Custom Fields, you can set a Featured Image - everything like on every other Page. Then go to 'Appearance' -> '404 Error Page' from your WordPress Dashbord and select the created Page as your 404 error page. That's it!
= Why you should choose this plugin =
* Different from other similar plugins the 404page plugin **does not create redirects**. Thats **quite important** because a correct code 404 is delivered which tells search engines that the page does not exist and has to be removed from the index. A redirect would result in a HTTP code 301 or 302 and the URL would remain in the search index.
* Different from other similar plugins the 404page plugin **does not create additional server requests**.
= Translations =
The 404page Plugin uses GlotPress - the wordpress.org Translation System - for translations. Translations can be submitted at [translate.wordpress.org](https://translate.wordpress.org/projects/wp-plugins/404page).
**Translation are highly appreciated**. It would be great if you'd support the 404page Plugin by adding a new translation or keeping an existing one up to date. If you're new to GlotPress take a look at the [Translator Handbook](https://make.wordpress.org/polyglots/handbook/tools/glotpress-translate-wordpress-org/).
= Do you like the 404page Plugin? =
Thanks, I appreciate that. You dont need to make a donation. No money, no beer, no coffee. Please, just [tell the world that you like what Im doing](http://petersplugins.com/make-a-donation/)! And thats all.
= More plugins from Peter =
* **[hashtagger](https://wordpress.org/plugins/hashtagger/)** - Use hashtags in WordPress
* **[smart Archive Page Remove](https://wordpress.org/plugins/smart-archive-page-remove/)** - Completely remove unwated Archive Pages from your Blog
* **[smart User Slug Hider](https://wordpress.org/plugins/smart-user-slug-hider/)** - Hide usernames in author pages URLs to enhance security
* [See all](https://profiles.wordpress.org/petersplugins/#content-plugins)
== Installation ==
= From your WordPress dashboard =
1. Visit 'Plugins' -> 'Add New'
1. Search for '404page'
1. Activate the plugin through the 'Plugins' menu in WordPress
= Manually from wordpress.org =
1. Download 404page from wordpress.org and unzip the archive
1. Upload the `404page` folder to your `/wp-content/plugins/` directory
1. Activate the plugin through the 'Plugins' menu in WordPress
== Frequently Asked Questions ==
= Are there any requirements? =
To enable the WordPress 404 error handling you have to set the Permalink Structure ('Settings' -> 'Permalinks') to anything else but 'Default'. Otherwise 404 errors are handled by the webserver and not by WordPress.
= Are 404 errors redirected? =
No, there is no redirection! The chosen page is delivered as a 'real' 404 error page. This results in a HTTP 404 code and not in 301 or 302, which is important for Search Engines to tell them, that the page does not exist and should be deleted from the index.
= What about PHP Version 7? =
The plugin works smoothly with PHP 7.
= Is it possible to add custom CSS to the 404 page? =
The 404page plugin adds a CSS class `error404` to the `<body>` tag which can be used for extra styling.
== Screenshots ==
1. Create your 404 Page as a normal WordPress Page
2. Define the created Page as 404 Error Page
3. Your custom 404 Error Page is shown in case of a 404 error
== Changelog ==
= 2.3 (2016-11-21) =
* a few minor bug fixes solve some problems with page templates in certain combinations
= 2.2 (2016-09-26) =
* automatic switch to Compatibility Mode for several plugins removed
* enhanced support for WPML and Polylang
* remove the 404 page from search results (for all languages if WPML or Polylang is used)
* remove the 404 page from sitemap or other page lists (for all languages if WPML or Polylang is used)
* bugfix for author archives
* confusing admin message removed
= 2.1 (2016-04-22) =
* introduction of selectable Operating Methods
* several changes to Compatibility Mode for improved WPML and bbPress compatibility plus compatibility with Page Builder by SiteOrigin
* Polylang compatibility
* automatic switch to Compatibility Mode if WPML, bbPress, Polylang or Page Builder by SiteOrigin is detected
* completely new Customizr Compatibility Mode (automatically enabled if Customizr is detected)
* firing an 404 error in case of directly accessing the 404 error page can now be deactivated
* WP Super Cache support
* option to hide the 404 error page from the Pages list
* 404 error test
* plugin expandable by action
* delete all settings on uninstall
= 2.0 (2016-03-08) =
* WPML compatibility
* bbPress compatibility
* Customizr compatibility
* directly accessing the 404 error page now throws an 404 error
* class `error404` added to the classes that are assigned to the body HTML element
* the settings menu was moved from 'Settings' to 'Appearance'
* translation files removed, using GlotPress exclusively
* [Read more](http://petersplugins.com/blog/2016/02/23/the-404page-plugin-now-works-with-wpml-and-other-enhancements/)
= 1.4 (2015-08-07) =
* edit the 404 page directly from settings page
* Portuguese translation
= 1.3 (2015-01-12) =
* technical improvement (rewritten as class)
* cosmetics
= 1.2 (2014-07-28) =
* Spanish translation
* Serbo-Croatian translation
= 1.1 (2014-06-03) =
* Multilingual support added
* German translation
= 1.0 (2013-09-30) =
* Initial Release
== Upgrade Notice ==
= 2.2 =
Enhanced compatibility. Automated Operating Method select removed. Several fixes.
= 2.1 =
Introduced Compatibility Mode, improved compatibility with several plugins.
= 2.0 =
Version 2.0 is more or less a completely new development and a big step forward. [Read more](http://petersplugins.com/blog/2016/02/23/the-404page-plugin-now-works-with-wpml-and-other-enhancements/)
= 1.4 =
Editing of the 404 page is now possible directly from settings page. Portuguese translation added.
== Compatibility ==
= The 404page plugin was sucessfully tested by the author with the following themes =
* [Athena](https://wordpress.org/themes/athena/)
* [Customizr](https://wordpress.org/themes/customizr/) (Read more about [Customizr Compatibility Mode](http://petersplugins.com/docs/404page/#settings_operating_method))
* [evolve](https://wordpress.org/themes/evolve/)
* [GeneratePress](https://wordpress.org/themes/generatepress/)
* [Graphene](https://wordpress.org/themes/graphene/)
* [Hemingway](https://wordpress.org/themes/hemingway/)
* [Hueman](https://wordpress.org/themes/hueman/)
* [Responsive](https://wordpress.org/themes/responsive/)
* [Spacious](https://wordpress.org/themes/spacious/)
* [Sparkling](https://wordpress.org/themes/sparkling/)
* [Sydney](https://wordpress.org/themes/sydney/)
* [Twenty Ten](https://wordpress.org/themes/twentyten/)
* [Twenty Eleven](https://wordpress.org/themes/twentyeleven/)
* [Twenty Twelve](https://wordpress.org/themes/twentytwelve/)
* [Twenty Thirteen](https://wordpress.org/themes/twentythirteen/)
* [Twenty Fourteen](https://wordpress.org/themes/twentyfourteen/)
* [Twenty Fifteen](https://wordpress.org/themes/twentyfifteen/)
* [Twenty Sixteen](https://wordpress.org/themes/twentysixteen/)
* [Vantage](https://wordpress.org/themes/vantage/)
* [Virtue](https://wordpress.org/themes/virtue/)
* [Zerif Lite](http://themeisle.com/themes/zerif-lite/)
= The 404page plugin was sucessfully tested by the author with the following starter themes =
* [Bones}(http://themble.com/bones/)
* [JointsWP](http://jointswp.com/)
* [undersores](http://underscores.me/)
= The 404page plugin was sucessfully tested by the author with the following plugins =
* [bbPress](https://wordpress.org/plugins/bbpress/)
* [BuddyPress](https://wordpress.org/plugins/buddypress/)
* [hashtagger](https://wordpress.org/plugins/hashtagger/)
* [Page Builder by SiteOrigin](https://wordpress.org/plugins/siteorigin-panels/)
* [Polylang](https://wordpress.org/plugins/polylang/)
* [User Submitted Posts](https://wordpress.org/plugins/user-submitted-posts/)
* [WooCommerce](https://wordpress.org/plugins/woocommerce/)
* [WP Super Cache](https://wordpress.org/plugins/wp-super-cache/)(Read more about [WP Super Cache Compatibility](http://petersplugins.com/docs/404page/#wp_super_cache)
* [WPML WordPress Multilingual Plugin](https://wpml.org/)([officially approved by WPML team](https://wpml.org/plugin/404page/))
== For developers ==
= Action Hook =
The plugin adds an action hook 404page_after_404 which you can use to add extra functionality. The exact position the action occurs after an 404 error is detected depends on the Operating Method. Your function must not generate any output. There are no parameters.
= Native Support =
If you are a theme developer you can add native support for the 404page plugin to your theme for full control. [Read more](http://petersplugins.com/docs/404page/#theme_native_support).

@ -0,0 +1,12 @@
<?php
// 404page uninstall
if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) || ! WP_UNINSTALL_PLUGIN || dirname( WP_UNINSTALL_PLUGIN ) != dirname( plugin_basename( __FILE__ ) ) ) {
status_header( 404 );
exit;
}
include_once plugin_dir_path( __FILE__ ) . '404page.php';
$smart404page->uninstall();
?>

@ -0,0 +1,34 @@
# Only allow direct access to specific Web-available files.
# Apache 2.2
<IfModule !mod_authz_core.c>
Order Deny,Allow
Deny from all
</IfModule>
# Apache 2.4
<IfModule mod_authz_core.c>
Require all denied
</IfModule>
# Akismet CSS and JS
<FilesMatch "^(form\.js|akismet\.js|akismet\.css)$">
<IfModule !mod_authz_core.c>
Allow from all
</IfModule>
<IfModule mod_authz_core.c>
Require all granted
</IfModule>
</FilesMatch>
# Akismet images
<FilesMatch "^logo-full-2x\.png$">
<IfModule !mod_authz_core.c>
Allow from all
</IfModule>
<IfModule mod_authz_core.c>
Require all granted
</IfModule>
</FilesMatch>

@ -0,0 +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.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 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.
<signature of Ty Coon>, 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.

@ -0,0 +1,474 @@
#submitted-on {
position: relative;
}
#the-comment-list .author .akismet-user-comment-count {
display: inline;
}
#the-comment-list .author a span {
text-decoration: none;
color: #999;
}
#the-comment-list .author a span.akismet-span-link {
text-decoration: inherit;
color: inherit;
}
#the-comment-list .remove_url {
margin-left: 3px;
color: #999;
padding: 2px 3px 2px 0;
}
#the-comment-list .remove_url:hover {
color: #A7301F;
font-weight: bold;
padding: 2px 2px 2px 0;
}
#dashboard_recent_comments .akismet-status {
display: none;
}
.akismet-status {
float: right;
}
.akismet-status a {
color: #AAA;
font-style: italic;
}
table.comments td.comment p a {
text-decoration: underline;
}
table.comments td.comment p a:after {
content: attr(href);
color: #aaa;
display: inline-block; /* Show the URL without the link's underline extending under it. */
padding: 0 1ex; /* Because it's inline block, we can't just use spaces in the content: attribute to separate it from the link text. */
}
.mshot-arrow {
width: 0;
height: 0;
border-top: 10px solid transparent;
border-bottom: 10px solid transparent;
border-right: 10px solid #5C5C5C;
position: absolute;
left: -6px;
top: 91px;
}
.mshot-container {
background: #5C5C5C;
position: absolute;
top: -94px;
padding: 7px;
width: 450px;
height: 338px;
z-index: 20000;
-moz-border-radius: 6px;
border-radius: 6px;
-webkit-border-radius: 6px;
}
.akismet-mshot {
position: absolute;
z-index: 100;
}
.akismet-mshot .mshot-image {
margin: 0;
height: 338px;
width: 450px;
}
h2.ak-header {
padding: 30px;
background: #649316 url('img/logo-full-2x.png') no-repeat 20px center;
background-size: 185px 33px;
height: 33px;
text-indent: -9999em;
margin-right: 10px;
}
.checkforspam {
display: inline-block !important;
}
.checkforspam-spinner {
display: inline-block;
margin-top: 7px;
}
.config-wrap {
margin-top: 2em;
max-width: 700px;
}
.activate-option {
background: #e3e3e3;
border-radius: 3px;
margin-bottom: 30px;
overflow: hidden;
padding: 20px;
}
.activate-option.clicked {
background: #649316;
color: #fff;
}
.activate-option.clicked:hover {
background: #68802E;
color: #fff;
}
.activate-option .button.button-secondary {
margin: 15px 0;
}
.activate-option p {
margin: 10px 0 10px;
}
.activate-highlight {
background: #fff;
padding: 30px;
margin-right: 10px;
}
.activate-highlight.secondary {
background: #ddd;
padding: 20px 30px;
}
.activate-highlight h3 {
margin: 0 0 0.3em;
}
.activate-highlight p {
color: #777;
}
.activate-highlight .button-primary {
margin-top: 15px;
}
#akismet-enter-api-key .regular-text {
width: 18em;
margin-top: 15px;
}
.right {
float: right;
}
.alert-text {
color: #dd3d36;
}
.success {
color: #649316;
}
.option-description {
float: left;
font-size: 16px;
}
.option-description span {
color: #666;
display: block;
font-size: 14px;
margin-top: 5px;
}
.option-action {
float: right;
}
.key-config-link {
font-size: 14px;
margin-left: 20px;
}
.jetpack-account {
float: left;
font-size: 18px;
margin-right: 40px;
}
.small-heading {
color: #777;
display: block;
font-size: 12px;
font-weight: bold;
margin-bottom: 5px;
text-transform: uppercase;
}
.inline-label {
background: #ddd;
border-radius: 3px;
font-size: 11px;
padding: 3px 8px;
text-transform: uppercase;
}
.inline-label.alert {
background: #e54747;
color: #fff;
}
.jetpack-account .inline-label {
margin-left: 5px;
}
.option-action .manual-key {
margin-top: 7px;
}
.alert {
border: 1px solid #e5e5e5;
padding: 0.4em 1em 1.4em 1em;
border-radius: 3px;
-webkit-border-radius: 3px;
border-width: 1px;
border-style: solid;
}
.alert h3.key-status {
color: #fff;
margin: 1em 0 0.5em 0;
}
.alert.critical {
background-color: #993300;
}
.alert.active {
background-color: #649316;
}
.alert p.key-status {
font-size: 24px;
}
.alert p.description {
color:#fff;
font-size: 14px;
margin: 0 0;
font-style: normal;
}
.alert p.description a,
.alert p.description a,
.alert p.description a,
.alert p.description a {
color: #fff;
}
.new-snapshot {
margin-top: 1em;
padding: 1em;
text-align: center;
}
.new-snapshot.stats {
background: #fff;
border: 1px solid #e5e5e5;
}
.new-snapshot h3 {
background: #f5f5f5;
color: #888;
font-size: 11px;
margin: 0;
padding: 3px;
}
.new-snapspot ul {
font-size: 12px;
width: 100%;
}
.new-snapshot ul li {
color: #999;
float: left;
font-size: 11px;
padding: 0 20px;
text-transform: uppercase;
width: 33%;
box-sizing: border-box;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
-ms-box-sizing: border-box;
}
.new-snapshot.stats ul li:first-child,
.new-snapshot.stats ul li:nth-child(2) {
border-right:1px dotted #ccc;
}
.new-snapshot.account ul li:nth-child(2) {
border-right: none;
}
.new-snapshot ul li span {
color: #52accc;
display: block;
font-size: 32px;
font-weight: lighter;
line-height: 1.5em;
}
.new-snapshot.stats {
}
.new-snapshot.account,
.new-snapshot.settings {
float: left;
padding: 0;
text-align: left;
width: 50%;
box-sizing: border-box;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
-ms-box-sizing: border-box;
}
.account-container {
background: #fff;
border: 1px solid #e5e5e5;
margin-right: 0.5em;
}
.settings-container {
background: #fff;
border: 1px solid #e5e5e5;
margin-left: 0.5em;
}
.new-snapshot.account ul li {
width:100%
}
.new-snapshot.account ul li span {
font-size: 14px;
font-weight: normal;
}
.new-snapshot.settings ul li {
border: none;
display: block;
width:100%
}
.new-snapshot.settings ul li span {
display: block;
font-size: 14px;
font-weight: normal;
}
.new-snapshot.settings p.submit {
margin: 0;
text-align: center;
}
.akismet-settings th:first-child {
vertical-align: top;
padding-top: 15px;
}
.akismet-settings th.akismet-api-key {
vertical-align: middle;
padding-top: 0;
}
.akismet-settings input[type=text] {
width: 75%;
}
.akismet-settings span.note{
float: left;
padding-left: 23px;
font-size: 75%;
margin-top: -10px;
}
.clearfix {
clear:both;
}
/**
* For the activation notice on the plugins page.
*/
.akismet_activate {
min-width: 825px;
border: 1px solid #4F800D;
padding: 5px;
margin: 15px 0;
background: #83AF24;
background-image: -webkit-gradient(linear, 0% 0, 80% 100%, from(#83AF24), to(#4F800D));
background-image: -moz-linear-gradient(80% 100% 120deg, #4F800D, #83AF24);
-moz-border-radius: 3px;
border-radius: 3px;
-webkit-border-radius: 3px;
position: relative;
overflow: hidden;
}
.akismet_activate .aa_a {
position: absolute;
top: -5px;
right: 10px;
font-size: 140px;
color: #769F33;
font-family: Georgia, "Times New Roman", Times, serif;
z-index: 1;
}
.akismet_activate .aa_button {
font-weight: bold;
border: 1px solid #029DD6;
border-top: 1px solid #06B9FD;
font-size: 15px;
text-align: center;
padding: 9px 0 8px 0;
color: #FFF;
background: #029DD6;
background-image: -webkit-gradient(linear, 0% 0, 0% 100%, from(#029DD6), to(#0079B1));
background-image: -moz-linear-gradient(0% 100% 90deg, #0079B1, #029DD6);
-moz-border-radius: 2px;
border-radius: 2px;
-webkit-border-radius: 2px;
width: 100%;
cursor: pointer;
margin: 0;
}
.akismet_activate .aa_button:hover {
text-decoration: none !important;
border: 1px solid #029DD6;
border-bottom: 1px solid #00A8EF;
font-size: 15px;
text-align: center;
padding: 9px 0 8px 0;
color: #F0F8FB;
background: #0079B1;
background-image: -webkit-gradient(linear, 0% 0, 0% 100%, from(#0079B1), to(#0092BF));
background-image: -moz-linear-gradient(0% 100% 90deg, #0092BF, #0079B1);
-moz-border-radius: 2px;
border-radius: 2px;
-webkit-border-radius: 2px;
}
.akismet_activate .aa_button_border {
border: 1px solid #006699;
-moz-border-radius: 2px;
border-radius: 2px;
-webkit-border-radius: 2px;
background: #029DD6;
background-image: -webkit-gradient(linear, 0% 0, 0% 100%, from(#029DD6), to(#0079B1));
background-image: -moz-linear-gradient(0% 100% 90deg, #0079B1, #029DD6);
}
.akismet_activate .aa_button_container {
display: inline-block;
background: #DEF1B8;
padding: 5px;
-moz-border-radius: 2px;
border-radius: 2px;
-webkit-border-radius: 2px;
width: 266px;
}
.akismet_activate .aa_description {
position: absolute;
top: 22px;
left: 285px;
margin-left: 25px;
color: #E5F2B1;
font-size: 15px;
z-index: 1000;
}
.akismet_activate .aa_description strong {
color: #FFF;
font-weight: normal;
}

@ -0,0 +1,197 @@
jQuery( function ( $ ) {
var mshotRemovalTimer = null;
var mshotSecondTryTimer = null
var mshotThirdTryTimer = null
$( 'a.activate-option' ).click( function(){
var link = $( this );
if ( link.hasClass( 'clicked' ) ) {
link.removeClass( 'clicked' );
}
else {
link.addClass( 'clicked' );
}
$( '.toggle-have-key' ).slideToggle( 'slow', function() {});
return false;
});
$('.akismet-status').each(function () {
var thisId = $(this).attr('commentid');
$(this).prependTo('#comment-' + thisId + ' .column-comment');
});
$('.akismet-user-comment-count').each(function () {
var thisId = $(this).attr('commentid');
$(this).insertAfter('#comment-' + thisId + ' .author strong:first').show();
});
$('#the-comment-list')
.find('tr.comment, tr[id ^= "comment-"]')
.find('.column-author a[href^="http"]:first') // Ignore mailto: links, which would be the comment author's email.
.each(function () {
var linkHref = $(this).attr( 'href' );
// Ignore any links to the current domain, which are diagnostic tools, like the IP address link
// or any other links another plugin might add.
var currentHostParts = document.location.href.split( '/' );
var currentHost = currentHostParts[0] + '//' + currentHostParts[2] + '/';
if ( linkHref.indexOf( currentHost ) != 0 ) {
var thisCommentId = $(this).parents('tr:first').attr('id').split("-");
$(this)
.attr("id", "author_comment_url_"+ thisCommentId[1])
.after(
$( '<a href="#" class="remove_url">x</a>' )
.attr( 'commentid', thisCommentId[1] )
.attr( 'title', WPAkismet.strings['Remove this URL'] )
);
}
});
$( '#the-comment-list' ).on( 'click', '.remove_url', function () {
var thisId = $(this).attr('commentid');
var data = {
action: 'comment_author_deurl',
_wpnonce: WPAkismet.comment_author_url_nonce,
id: thisId
};
$.ajax({
url: ajaxurl,
type: 'POST',
data: data,
beforeSend: function () {
// Removes "x" link
$("a[commentid='"+ thisId +"']").hide();
// Show temp status
$("#author_comment_url_"+ thisId).html( $( '<span/>' ).text( WPAkismet.strings['Removing...'] ) );
},
success: function (response) {
if (response) {
// Show status/undo link
$("#author_comment_url_"+ thisId)
.attr('cid', thisId)
.addClass('akismet_undo_link_removal')
.html(
$( '<span/>' ).text( WPAkismet.strings['URL removed'] )
)
.append( ' ' )
.append(
$( '<span/>' )
.text( WPAkismet.strings['(undo)'] )
.addClass( 'akismet-span-link' )
);
}
}
});
return false;
}).on( 'click', '.akismet_undo_link_removal', function () {
var thisId = $(this).attr('cid');
var thisUrl = $(this).attr('href');
var data = {
action: 'comment_author_reurl',
_wpnonce: WPAkismet.comment_author_url_nonce,
id: thisId,
url: thisUrl
};
$.ajax({
url: ajaxurl,
type: 'POST',
data: data,
beforeSend: function () {
// Show temp status
$("#author_comment_url_"+ thisId).html( $( '<span/>' ).text( WPAkismet.strings['Re-adding...'] ) );
},
success: function (response) {
if (response) {
// Add "x" link
$("a[commentid='"+ thisId +"']").show();
// Show link. Core strips leading http://, so let's do that too.
$("#author_comment_url_"+ thisId).removeClass('akismet_undo_link_removal').text( thisUrl.replace( /^http:\/\/(www\.)?/ig, '' ) );
}
}
});
return false;
});
// Show a preview image of the hovered URL. Applies to author URLs and URLs inside the comments.
$( 'a[id^="author_comment_url"], tr.pingback td.column-author a:first-of-type, table.comments td.comment p a' ).mouseover( function () {
clearTimeout( mshotRemovalTimer );
if ( $( '.akismet-mshot' ).length > 0 ) {
if ( $( '.akismet-mshot:first' ).data( 'link' ) == this ) {
// The preview is already showing for this link.
return;
}
else {
// A new link is being hovered, so remove the old preview.
$( '.akismet-mshot' ).remove();
}
}
clearTimeout( mshotSecondTryTimer );
clearTimeout( mshotThirdTryTimer );
var thisHref = $.URLEncode( $( this ).attr( 'href' ) );
var mShot = $( '<div class="akismet-mshot mshot-container"><div class="mshot-arrow"></div><img src="//s0.wordpress.com/mshots/v1/' + thisHref + '?w=450" width="450" height="338" class="mshot-image" /></div>' );
mShot.data( 'link', this );
var offset = $( this ).offset();
mShot.offset( {
left : Math.min( $( window ).width() - 475, offset.left + $( this ).width() + 10 ), // Keep it on the screen if the link is near the edge of the window.
top: offset.top + ( $( this ).height() / 2 ) - 101 // 101 = top offset of the arrow plus the top border thickness
} );
mshotSecondTryTimer = setTimeout( function () {
mShot.find( '.mshot-image' ).attr( 'src', '//s0.wordpress.com/mshots/v1/'+thisHref+'?w=450&r=2' );
}, 6000 );
mshotThirdTryTimer = setTimeout( function () {
mShot.find( '.mshot-image' ).attr( 'src', '//s0.wordpress.com/mshots/v1/'+thisHref+'?w=450&r=3' );
}, 12000 );
$( 'body' ).append( mShot );
} ).mouseout( function () {
mshotRemovalTimer = setTimeout( function () {
clearTimeout( mshotSecondTryTimer );
clearTimeout( mshotThirdTryTimer );
$( '.akismet-mshot' ).remove();
}, 200 );
} );
$('.checkforspam:not(.button-disabled)').click( function(e) {
$('.checkforspam:not(.button-disabled)').addClass('button-disabled');
$('.checkforspam-spinner').addClass( 'spinner' );
akismet_check_for_spam(0, 100);
e.preventDefault();
});
function akismet_check_for_spam(offset, limit) {
$.post(
ajaxurl,
{
'action': 'akismet_recheck_queue',
'offset': offset,
'limit': limit
},
function(result) {
if (result.counts.processed < limit) {
window.location.reload();
}
else {
// Account for comments that were caught as spam and moved out of the queue.
akismet_check_for_spam(offset + limit - result.counts.spam, limit);
}
}
);
}
});
// URL encode plugin
jQuery.extend({URLEncode:function(c){var o='';var x=0;c=c.toString();var r=/(^[a-zA-Z0-9_.]*)/;
while(x<c.length){var m=r.exec(c.substr(x));
if(m!=null && m.length>1 && m[1]!=''){o+=m[1];x+=m[1].length;
}else{if(c[x]==' ')o+='+';else{var d=c.charCodeAt(x);var h=d.toString(16);
o+='%'+(h.length<2?'0':'')+h.toUpperCase();}x++;}}return o;}
});

@ -0,0 +1,30 @@
var ak_js = document.getElementById( "ak_js" );
if ( ! ak_js ) {
ak_js = document.createElement( 'input' );
ak_js.setAttribute( 'id', 'ak_js' );
ak_js.setAttribute( 'name', 'ak_js' );
ak_js.setAttribute( 'type', 'hidden' );
}
else {
ak_js.parentNode.removeChild( ak_js );
}
ak_js.setAttribute( 'value', ( new Date() ).getTime() );
var commentForm = document.getElementById( 'commentform' );
if ( commentForm ) {
commentForm.appendChild( ak_js );
}
else {
var replyRowContainer = document.getElementById( 'replyrow' );
if ( replyRowContainer ) {
var children = replyRowContainer.getElementsByTagName( 'td' );
if ( children.length > 0 ) {
children[0].appendChild( ak_js );
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

@ -0,0 +1,63 @@
<?php
/**
* @package Akismet
*/
/*
Plugin Name: Akismet
Plugin URI: https://akismet.com/
Description: Used by millions, Akismet is quite possibly the best way in the world to <strong>protect your blog from spam</strong>. It keeps your site protected even while you sleep. To get started: 1) Click the "Activate" link to the left of this description, 2) <a href="https://akismet.com/get/">Sign up for an Akismet plan</a> to get an API key, and 3) Go to your Akismet configuration page, and save your API key.
Version: 3.2
Author: Automattic
Author URI: https://automattic.com/wordpress-plugins/
License: GPLv2 or later
Text Domain: akismet
*/
/*
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.
Copyright 2005-2015 Automattic, Inc.
*/
// Make sure we don't expose any info if called directly
if ( !function_exists( 'add_action' ) ) {
echo 'Hi there! I\'m just a plugin, not much I can do when called directly.';
exit;
}
define( 'AKISMET_VERSION', '3.2' );
define( 'AKISMET__MINIMUM_WP_VERSION', '3.7' );
define( 'AKISMET__PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
define( 'AKISMET_DELETE_LIMIT', 100000 );
register_activation_hook( __FILE__, array( 'Akismet', 'plugin_activation' ) );
register_deactivation_hook( __FILE__, array( 'Akismet', 'plugin_deactivation' ) );
require_once( AKISMET__PLUGIN_DIR . 'class.akismet.php' );
require_once( AKISMET__PLUGIN_DIR . 'class.akismet-widget.php' );
add_action( 'init', array( 'Akismet', 'init' ) );
if ( is_admin() || ( defined( 'WP_CLI' ) && WP_CLI ) ) {
require_once( AKISMET__PLUGIN_DIR . 'class.akismet-admin.php' );
add_action( 'init', array( 'Akismet_Admin', 'init' ) );
}
//add wrapper class around deprecated akismet functions that are referenced elsewhere
require_once( AKISMET__PLUGIN_DIR . 'wrapper.php' );
if ( defined( 'WP_CLI' ) && WP_CLI ) {
require_once( AKISMET__PLUGIN_DIR . 'class.akismet-cli.php' );
}

File diff suppressed because it is too large Load Diff

@ -0,0 +1,91 @@
<?php
WP_CLI::add_command( 'akismet', 'Akismet_CLI' );
/**
* Filter spam comments.
*/
class Akismet_CLI extends WP_CLI_Command {
/**
* Checks one or more comments against the Akismet API.
*
* ## OPTIONS
* <comment_id>...
* : The ID(s) of the comment(s) to check.
*
* [--noaction]
* : Don't change the status of the comment. Just report what Akismet thinks it is.
*
* ## EXAMPLES
*
* wp akismet check 12345
*
* @alias comment-check
*/
public function check( $args, $assoc_args ) {
foreach ( $args as $comment_id ) {
if ( isset( $assoc_args['noaction'] ) ) {
// Check the comment, but don't reclassify it.
$api_response = Akismet::check_db_comment( $comment_id, 'wp-cli' );
}
else {
$api_response = Akismet::recheck_comment( $comment_id, 'wp-cli' );
}
if ( 'true' === $api_response ) {
WP_CLI::line( sprintf( __( "Comment #%d is spam.", 'akismet' ), $comment_id ) );
}
else if ( 'false' === $api_response ) {
WP_CLI::line( sprintf( __( "Comment #%d is not spam.", 'akismet' ), $comment_id ) );
}
else {
if ( false === $api_response ) {
WP_CLI::error( __( "Failed to connect to Akismet.", 'akismet' ) );
}
else if ( is_wp_error( $api_response ) ) {
WP_CLI::warning( sprintf( __( "Comment #%d could not be checked.", 'akismet' ), $comment_id ) );
}
}
}
}
/**
* Recheck all comments in the Pending queue.
*
* ## EXAMPLES
*
* wp akismet recheck_queue
*
* @alias recheck-queue
*/
public function recheck_queue() {
$batch_size = 100;
$start = 0;
$total_counts = array();
do {
$result_counts = Akismet_Admin::recheck_queue_portion( $start, $batch_size );
if ( $result_counts['processed'] > 0 ) {
foreach ( $result_counts as $key => $count ) {
if ( ! isset( $total_counts[ $key ] ) ) {
$total_counts[ $key ] = $count;
}
else {
$total_counts[ $key ] += $count;
}
}
$start += $batch_size;
$start -= $result_counts['spam']; // These comments will have been removed from the queue.
}
} while ( $result_counts['processed'] > 0 );
WP_CLI::line( sprintf( _n( "Processed %d comment.", "Processed %d comments.", $total_counts['processed'], 'akismet' ), number_format( $total_counts['processed'] ) ) );
WP_CLI::line( sprintf( _n( "%d comment moved to Spam.", "%d comments moved to Spam.", $total_counts['spam'], 'akismet' ), number_format( $total_counts['spam'] ) ) );
if ( $total_counts['error'] ) {
WP_CLI::line( sprintf( _n( "%d comment could not be checked.", "%d comments could not be checked.", $total_counts['error'], 'akismet' ), number_format( $total_counts['error'] ) ) );
}
}
}

@ -0,0 +1,114 @@
<?php
/**
* @package Akismet
*/
class Akismet_Widget extends WP_Widget {
function __construct() {
load_plugin_textdomain( 'akismet' );
parent::__construct(
'akismet_widget',
__( 'Akismet Widget' , 'akismet'),
array( 'description' => __( 'Display the number of spam comments Akismet has caught' , 'akismet') )
);
if ( is_active_widget( false, false, $this->id_base ) ) {
add_action( 'wp_head', array( $this, 'css' ) );
}
}
function css() {
?>
<style type="text/css">
.a-stats {
width: auto;
}
.a-stats a {
background: #7CA821;
background-image:-moz-linear-gradient(0% 100% 90deg,#5F8E14,#7CA821);
background-image:-webkit-gradient(linear,0% 0,0% 100%,from(#7CA821),to(#5F8E14));
border: 1px solid #5F8E14;
border-radius:3px;
color: #CFEA93;
cursor: pointer;
display: block;
font-weight: normal;
height: 100%;
-moz-border-radius:3px;
padding: 7px 0 8px;
text-align: center;
text-decoration: none;
-webkit-border-radius:3px;
width: 100%;
}
.a-stats a:hover {
text-decoration: none;
background-image:-moz-linear-gradient(0% 100% 90deg,#6F9C1B,#659417);
background-image:-webkit-gradient(linear,0% 0,0% 100%,from(#659417),to(#6F9C1B));
}
.a-stats .count {
color: #FFF;
display: block;
font-size: 15px;
line-height: 16px;
padding: 0 13px;
white-space: nowrap;
}
</style>
<?php
}
function form( $instance ) {
if ( $instance ) {
$title = $instance['title'];
}
else {
$title = __( 'Spam Blocked' , 'akismet' );
}
?>
<p>
<label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php esc_html_e( 'Title:' , 'akismet'); ?></label>
<input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" />
</p>
<?php
}
function update( $new_instance, $old_instance ) {
$instance['title'] = strip_tags( $new_instance['title'] );
return $instance;
}
function widget( $args, $instance ) {
$count = get_option( 'akismet_spam_count' );
if ( ! isset( $instance['title'] ) ) {
$instance['title'] = __( 'Spam Blocked' , 'akismet' );
}
echo $args['before_widget'];
if ( ! empty( $instance['title'] ) ) {
echo $args['before_title'];
echo esc_html( $instance['title'] );
echo $args['after_title'];
}
?>
<div class="a-stats">
<a href="https://akismet.com" target="_blank" title=""><?php printf( _n( '<strong class="count">%1$s spam</strong> blocked by <strong>Akismet</strong>', '<strong class="count">%1$s spam</strong> blocked by <strong>Akismet</strong>', $count , 'akismet'), number_format_i18n( $count ) ); ?></a>
</div>
<?php
echo $args['after_widget'];
}
}
function akismet_register_widgets() {
register_widget( 'Akismet_Widget' );
}
add_action( 'widgets_init', 'akismet_register_widgets' );

File diff suppressed because it is too large Load Diff

@ -0,0 +1,2 @@
<?php
# Silence is golden.

@ -0,0 +1,345 @@
=== Akismet ===
Contributors: matt, ryan, andy, mdawaffe, tellyworth, josephscott, lessbloat, eoigal, cfinke, automattic, jgs
Tags: akismet, comments, spam, antispam, anti-spam, anti spam, comment moderation, comment spam, contact form spam, spam comments
Requires at least: 3.7
Tested up to: 4.6.1
Stable tag: 3.2
License: GPLv2 or later
Akismet checks your comments against the Akismet Web service to see if they look like spam or not.
== Description ==
Akismet checks your comments against the Akismet Web service to see if they look like spam or not and lets you review the spam it catches under your blog's "Comments" admin screen.
Major features in Akismet include:
* Automatically checks all comments and filters out the ones that look like spam.
* Each comment has a status history, so you can easily see which comments were caught or cleared by Akismet and which were spammed or unspammed by a moderator.
* URLs are shown in the comment body to reveal hidden or misleading links.
* Moderators can see the number of approved comments for each user.
* A discard feature that outright blocks the worst spam, saving you disk space and speeding up your site.
PS: You'll need an [Akismet.com API key](https://akismet.com/get/) to use it. Keys are free for personal blogs; paid subscriptions are available for businesses and commercial sites.
== Installation ==
Upload the Akismet plugin to your blog, Activate it, then enter your [Akismet.com API key](https://akismet.com/get/).
1, 2, 3: You're done!
== Changelog ==
= 3.2 =
*Release Date - 6 September 2016*
* Added a WP-CLI module. You can now check comments and recheck the moderation queue from the command line.
* Stopped using the deprecated jQuery function `.live()`.
* Fixed a bug in `remove_comment_author_url()` and `add_comment_author_url()` that could generate PHP notices.
* Fixed a bug that could cause an infinite loop for sites with very very very large comment IDs.
* Fixed a bug that could cause the Akismet widget title to be blank.
= 3.1.11 =
*Release Date - 12 May 2016*
* Fixed a bug that could cause the "Check for Spam" button to skip some comments.
* Fixed a bug that could prevent some spam submissions from being sent to Akismet.
* Updated all links to use https:// when possible.
* Disabled Akismet debug logging unless WP_DEBUG and WP_DEBUG_LOG are both enabled.
= 3.1.10 =
*Release Date - 1 April 2016*
* Fixed a bug that could cause comments caught as spam to be placed in the Pending queue.
* Fixed a bug that could have resulted in comments that were caught by the core WordPress comment blacklist not to have a corresponding History entry.
* Fixed a bug that could have caused avoidable PHP warnings in the error log.
= 3.1.9 =
*Release Date - 28 March 2016*
* Add compatibility with Jetpack so that Jetpack can automatically configure Akismet settings when appropriate.
* Fixed a bug preventing some comment data from being sent to Akismet.
= 3.1.8 =
*Release Date - 4 March 2016*
* Fixed a bug preventing Akismet from being used with some plugins that rewrite admin URLs.
* Reduced the amount of bandwidth used on Akismet API calls
* Reduced the amount of space Akismet uses in the database
* Fixed a bug that could cause comments caught as spam to be placed in the Pending queue.
= 3.1.7 =
*Release Date - 4 January 2016*
* Added documentation for the 'akismet_comment_nonce' filter.
* The post-install activation button is now accessible to screen readers and keyboard-only users.
* Fixed a bug that was preventing the "Remove author URL" feature from working in WordPress 4.4
= 3.1.6 =
*Release Date - 14 December 2015*
* Improve the notices shown after activating Akismet.
* Update some strings to allow for the proper plural forms in all languages.
= 3.1.5 =
*Release Date - 13 October 2015*
* Closes a potential XSS vulnerability.
= 3.1.4 =
*Release Date - 24 September 2015*
* Fixed a bug that was preventing some users from automatically connecting using Jetpack if they didn't have a current Akismet subscription.
* Fixed a bug that could cause comments caught as spam to be placed in the Pending queue.
* Error messages and instructions have been simplified to be more understandable.
* Link previews are enabled for all links inside comments, not just the author's website link.
= 3.1.3 =
*Release Date - 6 July 2015*
* Notify users when their account status changes after previously being successfully set up. This should help any users who are seeing blank Akismet settings screens.
= 3.1.2 =
*Release Date - 7 June 2015*
* Reduced the amount of space Akismet uses in the commentmeta table.
* Fixed a bug where some comments with quotes in the author name weren't getting history entries
* Pre-emptive security improvements to ensure that the Akismet plugin can't be used by attackers to compromise a WordPress installation.
* Better UI for the key entry field: allow whitespace to be included at the beginning or end of the key and strip it out automatically when the form is submitted.
* When deactivating the plugin, notify the Akismet API so the site can be marked as inactive.
* Clearer error messages.
= 3.1.1 =
*Release Date - 17th March, 2015*
* Improvements to the "Remove comment author URL" JavaScript
* Include the pingback pre-check from the 2.6 branch.
= 3.1 =
*Release Date - 11th March, 2015*
* Use HTTPS by default for all requests to Akismet.
* Fix for a situation where Akismet might strip HTML from a comment.
= 3.0.4 =
*Release Date - 11th December, 2014*
* Fix to make .htaccess compatible with Apache 2.4.
* Fix to allow removal of https author URLs.
* Fix to avoid stripping part of the author URL when removing and re-adding.
* Removed the "Check for Spam" button from the "Trash" and "Approved" queues, where it would have no effect.
* Allow automatic API key configuration when Jetpack is installed and connected to a WordPress.com account
= 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
* Remove unnecessary data from some Akismet comment meta
* 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
* Add Akismet subscription details and status to Akismet settings
* Add contextual help for each page
* Improve Akismet setup to use Jetpack to automate plugin setup
* Fix "Check for Spam" to use AJAX to avoid page timing out
* Fix Akismet settings page to be responsive
* Drop legacy code
* Tidy up CSS and Javascript
* 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
* Fix bug with deleting old comments to avoid timeouts dealing with large volumes of comments
* Include X-Pingback-Forwarded-For header in outbound WordPress pingback verifications
* 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
* Prevent some PHP notices
* Fix Check For Spam return location when referrer is empty
* Fix Settings links for network admins
* 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
* Fix a bug where comments were not held for moderation during an error condition
* Improve the UX and display when comments are temporarily held due to an error
* Make the Check For Spam button force a retry when comments are held due to an error
* Handle errors caused by an invalid key
* Don't retry comments that are too old
* 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
* Added empty index.php to prevent directory listing
* Move wp-admin menu items under Jetpack, if it is installed
* 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
* Increase the HTTP request timeout
* Removed padding for author approved count
* Fix typo in function name
* 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
* Fixed padding bug in "author" column of posts screen
* Added margin-top to "cleared by ..." badges on dashboard
* Fix possible error when calling akismet_cron_recheck()
* Fix more PHP warnings
* Clean up XHTML warnings for comment nonce
* Fix for possible condition where scheduled comment re-checks could get stuck
* Clean up the comment meta details after deleting a comment
* Only show the status badge if the comment status has been changed by someone/something other than Akismet
* Show a 'History' link in the row-actions
* Translation fixes
* Reduced font-size on author name
* Moved "flagged by..." notification to top right corner of comment container and removed heavy styling
* 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 )
* Use HTTPS for the stats IFRAME when wp-admin is using HTTPS
* Use the WordPress HTTP class if available
* Move the admin UI code to a separate file, only loaded when needed
* Add cron retry feature, to replace the old connectivity check
* Display Akismet status badge beside each comment
* Record history for each comment, and display it on the edit page
* Record the complete comment as originally submitted in comment_meta, to use when reporting spam and ham
* Highlight links in comment content
* New option, "Show the number of comments you've approved beside each comment author."
* 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
* Fix WordPress deprecated function calls
* Fire the delete_comment action when deleting comments
* Move code specific for older WP versions to legacy.php
* 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
* Change author link; remove some old references to WordPress.com accounts
* 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
* Report comments as ham when clicking undo after spam
* Use transition_comment_status action when available instead of older actions for spam/ham submissions
* Better diagnostic messages when PHP network functions are unavailable
* 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
* Fix an array conversion warning in some versions of PHP
* 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

@ -0,0 +1,216 @@
<div class="wrap">
<h2><?php esc_html_e( 'Akismet' , 'akismet');?></h2>
<div class="have-key">
<?php if ( $stat_totals && isset( $stat_totals['all'] ) && (int) $stat_totals['all']->spam > 0 ) : ?>
<div class="new-snapshot stats">
<span style="float:right;margin:10px 15px -5px 0px">
<a href="<?php echo esc_url( Akismet_Admin::get_page_url( 'stats' ) ); ?>" class=""><?php esc_html_e( 'Summaries' , 'akismet');?></a>
</span>
<iframe allowtransparency="true" scrolling="no" frameborder="0" style="width: 100%; height: 215px; overflow: hidden;" src="<?php printf( '//akismet.com/web/1.0/snapshot.php?blog=%s&api_key=%s&height=180&locale=%s', urlencode( get_option( 'home' ) ), Akismet::get_api_key(), get_locale() );?>"></iframe>
<ul>
<li>
<h3><?php esc_html_e( 'Past six months' , 'akismet');?></h3>
<span><?php echo number_format( $stat_totals['6-months']->spam );?></span>
<?php echo esc_html( _n( 'Spam blocked', 'Spam blocked', $stat_totals['6-months']->spam, 'akismet' ) ); ?>
</li>
<li>
<h3><?php esc_html_e( 'All time' , 'akismet');?></h3>
<span><?php echo number_format( $stat_totals['all']->spam );?></span>
<?php echo esc_html( _n( 'Spam blocked', 'Spam blocked', $stat_totals['all']->spam, 'akismet' ) ); ?>
</li>
<li>
<h3><?php esc_html_e( 'Accuracy' , 'akismet');?></h3>
<span><?php echo floatval( $stat_totals['all']->accuracy ); ?>%</span>
<?php printf( _n( '%s missed spam', '%s missed spam', $stat_totals['all']->missed_spam, 'akismet' ), number_format( $stat_totals['all']->missed_spam ) ); ?>
|
<?php printf( _n( '%s false positive', '%s false positives', $stat_totals['all']->false_positives, 'akismet' ), number_format( $stat_totals['all']->false_positives ) ); ?>
</li>
</ul>
<div class="clearfix"></div>
</div>
<?php endif;?>
<?php if ( $akismet_user ):?>
<div id="wpcom-stats-meta-box-container" class="metabox-holder"><?php
wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false );
wp_nonce_field( 'meta-box-order', 'meta-box-order-nonce', false );
?>
<script type="text/javascript">
jQuery(document).ready( function($) {
jQuery('.if-js-closed').removeClass('if-js-closed').addClass('closed');
if(typeof postboxes !== 'undefined')
postboxes.add_postbox_toggles( 'plugins_page_akismet-key-config' );
});
</script>
<div class="postbox-container" style="width: 55%;margin-right: 10px;">
<div id="normal-sortables" class="meta-box-sortables ui-sortable">
<div id="referrers" class="postbox ">
<div class="handlediv" title="Click to toggle"><br></div>
<h3 class="hndle"><span><?php esc_html_e( 'Settings' , 'akismet');?></span></h3>
<form name="akismet_conf" id="akismet-conf" action="<?php echo esc_url( Akismet_Admin::get_page_url() ); ?>" method="POST">
<div class="inside">
<table cellspacing="0" class="akismet-settings">
<tbody>
<?php if ( !defined( 'WPCOM_API_KEY' ) ):?>
<tr>
<th class="akismet-api-key" width="10%" align="left" scope="row"><?php esc_html_e('API Key', 'akismet');?></th>
<td width="5%"/>
<td align="left">
<span class="api-key"><input id="key" name="key" type="text" size="15" value="<?php echo esc_attr( get_option('wordpress_api_key') ); ?>" class="<?php echo esc_attr( 'regular-text code ' . $akismet_user->status ); ?>"></span>
</td>
</tr>
<?php endif; ?>
<?php if ( isset( $_GET['ssl_status'] ) ) { ?>
<tr>
<th align="left" scope="row"><?php esc_html_e( 'SSL Status', 'akismet' ); ?></th>
<td></td>
<td align="left">
<p>
<?php
if ( ! function_exists( 'wp_http_supports' ) ) {
?><b><?php esc_html_e( 'Disabled.', 'akismet' ); ?></b> <?php printf( esc_html( 'Your WordPress installation does not include the function %s; upgrade to the latest version of WordPress.', 'akismet' ), '<code>wp_http_supports</code>' ); ?><?php
}
else if ( ! wp_http_supports( array( 'ssl' ) ) ) {
?><b><?php esc_html_e( 'Disabled.', 'akismet' ); ?></b> <?php esc_html_e( 'Your Web server cannot make SSL requests; contact your Web host and ask them to add support for SSL requests.', 'akismet' ); ?><?php
}
else {
$ssl_disabled = get_option( 'akismet_ssl_disabled' );
if ( $ssl_disabled ) {
?><b><?php esc_html_e( 'Temporarily disabled.', 'akismet' ); ?></b> <?php esc_html_e( 'Akismet encountered a problem with a previous SSL request and disabled it temporarily. It will begin using SSL for requests again shortly.', 'akismet' ); ?><?php
}
else {
?><b><?php esc_html_e( 'Enabled.', 'akismet' ); ?></b> <?php esc_html_e( 'All systems functional.', 'akismet' ); ?><?php
}
}
?>
</p>
</td>
</tr>
<?php } ?>
<tr>
<th align="left" scope="row"><?php esc_html_e('Comments', 'akismet');?></th>
<td></td>
<td align="left">
<p>
<label for="akismet_show_user_comments_approved" title="<?php esc_attr_e( 'Show approved comments' , 'akismet'); ?>"><input name="akismet_show_user_comments_approved" id="akismet_show_user_comments_approved" value="1" type="checkbox" <?php checked('1', get_option('akismet_show_user_comments_approved')); ?>> <?php esc_html_e('Show the number of approved comments beside each comment author', 'akismet'); ?></label>
</p>
</td>
</tr>
<tr>
<th class="strictness" align="left" scope="row"><?php esc_html_e('Strictness', 'akismet'); ?></th>
<td></td>
<td align="left">
<fieldset><legend class="screen-reader-text"><span><?php esc_html_e('Akismet anti-spam strictness', 'akismet'); ?></span></legend>
<p><label for="akismet_strictness_1"><input type="radio" name="akismet_strictness" id="akismet_strictness_1" value="1" <?php checked('1', get_option('akismet_strictness')); ?> /> <?php esc_html_e('Silently discard the worst and most pervasive spam so I never see it.', 'akismet'); ?></label></p>
<p><label for="akismet_strictness_0"><input type="radio" name="akismet_strictness" id="akismet_strictness_0" value="0" <?php checked('0', get_option('akismet_strictness')); ?> /> <?php esc_html_e('Always put spam in the Spam folder for review.', 'akismet'); ?></label></p>
</fieldset>
<span class="note"><strong><?php esc_html_e('Note:', 'akismet');?></strong>
<?php
$delete_interval = max( 1, intval( apply_filters( 'akismet_delete_comment_interval', 15 ) ) );
printf(
_n(
'Spam in the <a href="%1$s">spam folder</a> older than 1 day is deleted automatically.',
'Spam in the <a href="%1$s">spam folder</a> older than %2$d days is deleted automatically.',
$delete_interval,
'akismet'
),
admin_url( 'edit-comments.php?comment_status=spam' ),
$delete_interval
);
?>
</td>
</tr>
</tbody>
</table>
</div>
<div id="major-publishing-actions">
<?php if ( !defined( 'WPCOM_API_KEY' ) ):?>
<div id="delete-action">
<a class="submitdelete deletion" href="<?php echo esc_url( Akismet_Admin::get_page_url( 'delete_key' ) ); ?>"><?php esc_html_e('Disconnect this account', 'akismet'); ?></a>
</div>
<?php endif; ?>
<?php wp_nonce_field(Akismet_Admin::NONCE) ?>
<div id="publishing-action">
<input type="hidden" name="action" value="enter-key">
<input type="submit" name="submit" id="submit" class="button button-primary" value="<?php esc_attr_e('Save Changes', 'akismet');?>">
</div>
<div class="clear"></div>
</div>
</form>
</div>
</div>
</div>
<div class="postbox-container" style="width:44%;">
<div id="normal-sortables" class="meta-box-sortables ui-sortable">
<div id="referrers" class="postbox ">
<div class="handlediv" title="Click to toggle"><br></div>
<h3 class="hndle"><span><?php esc_html_e( 'Account' , 'akismet');?></span></h3>
<div class="inside">
<table cellspacing="0">
<tbody>
<tr>
<th scope="row" align="left"><?php esc_html_e( 'Subscription Type' , 'akismet');?></th>
<td width="5%"/>
<td align="left">
<span><?php echo esc_html( $akismet_user->account_name ); ?></span>
</td>
</tr>
<tr>
<th scope="row" align="left"><?php esc_html_e( 'Status' , 'akismet');?></th>
<td width="5%"/>
<td align="left">
<span><?php
if ( 'cancelled' == $akismet_user->status ) :
esc_html_e( 'Cancelled', 'akismet' );
elseif ( 'suspended' == $akismet_user->status ) :
esc_html_e( 'Suspended', 'akismet' );
elseif ( 'missing' == $akismet_user->status ) :
esc_html_e( 'Missing', 'akismet' );
elseif ( 'no-sub' == $akismet_user->status ) :
esc_html_e( 'No Subscription Found', 'akismet' );
else :
esc_html_e( 'Active', 'akismet' );
endif; ?></span>
</td>
</tr>
<?php if ( $akismet_user->next_billing_date ) : ?>
<tr>
<th scope="row" align="left"><?php esc_html_e( 'Next Billing Date' , 'akismet');?></th>
<td width="5%"/>
<td align="left">
<span><?php echo date( 'F j, Y', $akismet_user->next_billing_date ); ?></span>
</td>
</tr>
<?php endif; ?>
</tbody>
</table>
</div>
<div id="major-publishing-actions">
<div id="publishing-action">
<?php Akismet::view( 'get', array( 'text' => ( $akismet_user->account_type == 'free-api-key' && $akismet_user->status == 'active' ? __( 'Upgrade' , 'akismet') : __( 'Change' , 'akismet') ), 'redirect' => 'upgrade' ) ); ?>
</div>
<div class="clear"></div>
</div>
</div>
</div>
</div>
</div>
<?php endif;?>
</div>
</div>

@ -0,0 +1,6 @@
<form name="akismet_activate" action="https://akismet.com/get/" method="POST" target="_blank">
<input type="hidden" name="passback_url" value="<?php echo esc_url( Akismet_Admin::get_page_url() ); ?>"/>
<input type="hidden" name="blog" value="<?php echo esc_url( get_option( 'home' ) ); ?>"/>
<input type="hidden" name="redirect" value="<?php echo isset( $redirect ) ? $redirect : 'plugin-signup'; ?>"/>
<input type="submit" class="<?php echo isset( $classes ) && count( $classes ) > 0 ? implode( ' ', $classes ) : 'button button-primary';?>" value="<?php echo esc_attr( $text ); ?>"/>
</form>

@ -0,0 +1,123 @@
<?php if ( $type == 'plugin' ) :?>
<div class="updated" style="padding: 0; margin: 0; border: none; background: none;">
<form name="akismet_activate" action="<?php echo esc_url( Akismet_Admin::get_page_url() ); ?>" method="POST">
<div class="akismet_activate">
<div class="aa_a">A</div>
<div class="aa_button_container">
<div class="aa_button_border">
<input type="submit" class="aa_button" value="<?php esc_attr_e( 'Activate your Akismet account', 'akismet' ); ?>" />
</div>
</div>
<div class="aa_description"><?php _e('<strong>Almost done</strong> - activate Akismet and say goodbye to spam', 'akismet');?></div>
</div>
</form>
</div>
<?php elseif ( $type == 'spam-check' ) :?>
<div id="akismet-warning" class="updated fade">
<p><strong><?php esc_html_e( 'Akismet has detected a problem.', 'akismet' );?></strong></p>
<p><?php printf( __( 'Some comments have not yet been checked for spam by Akismet. They have been temporarily held for moderation and will automatically be rechecked later.', 'akismet' ) ); ?></p>
<?php if ( $link_text ) { ?>
<p><?php echo $link_text; ?></p>
<?php } ?>
</div>
<?php elseif ( $type == 'version' ) :?>
<div id="akismet-warning" class="updated fade"><p><strong><?php printf( esc_html__('Akismet %s requires WordPress 3.0 or higher.', 'akismet'), AKISMET_VERSION);?></strong> <?php printf(__('Please <a href="%1$s">upgrade WordPress</a> to a current version, or <a href="%2$s">downgrade to version 2.4 of the Akismet plugin</a>.', 'akismet'), 'https://codex.wordpress.org/Upgrading_WordPress', 'https://wordpress.org/extend/plugins/akismet/download/');?></p></div>
<?php elseif ( $type == 'alert' ) :?>
<div class='error'>
<p><strong><?php printf( esc_html__( 'Akismet Error Code: %s', 'akismet' ), $code ); ?></strong></p>
<p><?php echo esc_html( $msg ); ?></p>
<p><?php
/* translators: the placeholder is a clickable URL that leads to more information regarding an error code. */
printf( esc_html__( 'For more information: %s' , 'akismet'), '<a href="https://akismet.com/errors/' . $code . '">https://akismet.com/errors/' . $code . '</a>' );
?>
</p>
</div>
<?php elseif ( $type == 'notice' ) :?>
<div class="wrap alert critical">
<h3 class="key-status failed"><?php echo $notice_header; ?></h3>
<p class="description">
<?php echo $notice_text; ?>
</p>
</div>
<?php elseif ( $type == 'missing-functions' ) :?>
<div class="wrap alert critical">
<h3 class="key-status failed"><?php esc_html_e('Network functions are disabled.', 'akismet'); ?></h3>
<p class="description"><?php printf( __('Your web host or server administrator has disabled PHP&#8217;s <code>gethostbynamel</code> function. <strong>Akismet cannot work correctly until this is fixed.</strong> Please contact your web host or firewall administrator and give them <a href="%s" target="_blank">this information about Akismet&#8217;s system requirements</a>.', 'akismet'), 'https://blog.akismet.com/akismet-hosting-faq/'); ?></p>
</div>
<?php elseif ( $type == 'servers-be-down' ) :?>
<div class="wrap alert critical">
<h3 class="key-status failed"><?php esc_html_e("Akismet can&#8217;t connect to your site.", 'akismet'); ?></h3>
<p class="description"><?php printf( __('Your firewall may be blocking Akismet. Please contact your host and refer to <a href="%s" target="_blank">our guide about firewalls</a>.', 'akismet'), 'https://blog.akismet.com/akismet-hosting-faq/'); ?></p>
</div>
<?php elseif ( $type == 'active-dunning' ) :?>
<div class="wrap alert critical">
<h3 class="key-status"><?php esc_html_e("Please update your payment information.", 'akismet'); ?></h3>
<p class="description"><?php printf( __('We cannot process your payment. Please <a href="%s" target="_blank">update your payment details</a>.', 'akismet'), 'https://akismet.com/account/'); ?></p>
</div>
<?php elseif ( $type == 'cancelled' ) :?>
<div class="wrap alert critical">
<h3 class="key-status"><?php esc_html_e("Your Akismet plan has been cancelled.", 'akismet'); ?></h3>
<p class="description"><?php printf( __('Please visit your <a href="%s" target="_blank">Akismet account page</a> to reactivate your subscription.', 'akismet'), 'https://akismet.com/account/'); ?></p>
</div>
<?php elseif ( $type == 'suspended' ) :?>
<div class="wrap alert critical">
<h3 class="key-status failed"><?php esc_html_e("Your Akismet subscription is suspended.", 'akismet'); ?></h3>
<p class="description"><?php printf( __('Please contact <a href="%s" target="_blank">Akismet support</a> for assistance.', 'akismet'), 'https://akismet.com/contact/'); ?></p>
</div>
<?php elseif ( $type == 'active-notice' && $time_saved ) :?>
<div class="wrap alert active">
<h3 class="key-status"><?php echo esc_html( $time_saved ); ?></h3>
<p class="description"><?php printf( __('You can help us fight spam and upgrade your account by <a href="%s" target="_blank">contributing a token amount</a>.', 'akismet'), 'https://akismet.com/account/upgrade/'); ?></p>
</div>
<?php elseif ( $type == 'missing' ) :?>
<div class="wrap alert critical">
<h3 class="key-status failed"><?php esc_html_e( 'There is a problem with your API key.', 'akismet'); ?></h3>
<p class="description"><?php printf( __('Please contact <a href="%s" target="_blank">Akismet support</a> for assistance.', 'akismet'), 'https://akismet.com/contact/'); ?></p>
</div>
<?php elseif ( $type == 'no-sub' ) :?>
<div class="wrap alert critical">
<h3 class="key-status failed"><?php esc_html_e( 'You don&#8217;t have an Akismet plan.', 'akismet'); ?></h3>
<p class="description">
<?php printf( __( 'In 2012, Akismet began using subscription plans for all accounts (even free ones). A plan has not been assigned to your account, and we&#8217;d appreciate it if you&#8217;d <a href="%s" target="_blank">sign into your account</a> and choose one.', 'akismet'), 'https://akismet.com/account/upgrade/' ); ?>
<br /><br />
<?php printf( __( 'Please <a href="%s" target="_blank">contact our support team</a> with any questions.', 'akismet' ), 'https://akismet.com/contact/' ); ?>
</p>
</div>
<?php elseif ( $type == 'new-key-valid' ) :?>
<div class="wrap alert active">
<h3 class="key-status"><?php esc_html_e('Akismet is now activated. Happy blogging!', 'akismet'); ?></h3>
</div>
<?php elseif ( $type == 'new-key-invalid' ) :?>
<div class="wrap alert critical">
<h3 class="key-status"><?php esc_html_e( 'The key you entered is invalid. Please double-check it.' , 'akismet'); ?></h3>
</div>
<?php elseif ( $type == 'existing-key-invalid' ) :?>
<div class="wrap alert critical">
<h3 class="key-status"><?php esc_html_e( 'Your API key is no longer valid. Please enter a new key or contact support@akismet.com.' , 'akismet'); ?></h3>
</div>
<?php elseif ( $type == 'new-key-failed' ) :?>
<div class="wrap alert critical">
<h3 class="key-status"><?php esc_html_e( 'The API key you entered could not be verified.' , 'akismet'); ?></h3>
<p class="description"><?php printf( __('The connection to akismet.com could not be established. Please refer to <a href="%s" target="_blank">our guide about firewalls</a> and check your server configuration.', 'akismet'), 'https://blog.akismet.com/akismet-hosting-faq/'); ?></p>
</div>
<?php elseif ( $type == 'limit-reached' && in_array( $level, array( 'yellow', 'red' ) ) ) :?>
<div class="wrap alert critical">
<?php if ( $level == 'yellow' ): ?>
<h3 class="key-status failed"><?php esc_html_e( 'You&#8217;re using your Akismet key on more sites than your Pro subscription allows.', 'akismet' ); ?></h3>
<p class="description">
<?php printf( __( 'Your Pro subscription allows the use of Akismet on only one site. Please <a href="%s" target="_blank">purchase additional Pro subscriptions</a> or upgrade to an Enterprise subscription that allows the use of Akismet on unlimited sites.', 'akismet' ), 'https://docs.akismet.com/billing/add-more-sites/' ); ?>
<br /><br />
<?php printf( __( 'Please <a href="%s" target="_blank">contact our support team</a> with any questions.', 'akismet' ), 'https://akismet.com/contact/'); ?>
</p>
<?php elseif ( $level == 'red' ): ?>
<h3 class="key-status failed"><?php esc_html_e( 'You&#8217;re using Akismet on far too many sites for your Pro subscription.', 'akismet' ); ?></h3>
<p class="description">
<?php printf( __( 'To continue your service, <a href="%s" target="_blank">upgrade to an Enterprise subscription</a>, which covers an unlimited number of sites.', 'akismet'), 'https://akismet.com/account/upgrade/' ); ?></p>
<br /><br />
<?php printf( __( 'Please <a href="%s" target="_blank">contact our support team</a> with any questions.', 'akismet' ), 'https://akismet.com/contact/'); ?></p>
</p>
<?php endif; ?>
</div>
<?php endif;?>

@ -0,0 +1,97 @@
<div class="no-key config-wrap"><?php
if ( $akismet_user && in_array( $akismet_user->status, array( 'active', 'active-dunning', 'no-sub', 'missing', 'cancelled', 'suspended' ) ) ) :
if ( in_array( $akismet_user->status, array( 'no-sub', 'missing' ) ) ) :?>
<p><?php esc_html_e('Akismet eliminates spam from your site. Register below to get started.', 'akismet'); ?></p>
<div class="activate-highlight activate-option">
<div class="option-description">
<strong class="small-heading"><?php esc_html_e('Connected via Jetpack', 'akismet'); ?></strong>
<?php echo esc_html( $akismet_user->user_email ); ?>
</div>
<form name="akismet_activate" id="akismet_activate" action="https://akismet.com/get/" method="post" class="right" target="_blank">
<input type="hidden" name="passback_url" value="<?php echo esc_url( Akismet_Admin::get_page_url() ); ?>"/>
<input type="hidden" name="blog" value="<?php echo esc_url( get_option( 'home' ) ); ?>"/>
<input type="hidden" name="auto-connect" value="<?php echo esc_attr( $akismet_user->ID ); ?>"/>
<input type="hidden" name="redirect" value="plugin-signup"/>
<input type="submit" class="button button-primary" value="<?php esc_attr_e( 'Register for Akismet' , 'akismet'); ?>"/>
</form>
</div>
<?php elseif ( $akismet_user->status == 'cancelled' ) :?>
<p><?php esc_html_e('Akismet eliminates spam from your site.', 'akismet'); ?></p>
<div class="activate-highlight activate-option">
<div class="option-description" style="width:75%;">
<strong class="small-heading"><?php esc_html_e('Connected via Jetpack', 'akismet'); ?></strong>
<?php echo esc_html( sprintf( __( 'Your subscription for %s is cancelled' , 'akismet'), $akismet_user->user_email ) ); ?>
</div>
<form name="akismet_activate" id="akismet_activate" action="https://akismet.com/get/" method="post" class="right" target="_blank">
<input type="hidden" name="passback_url" value="<?php echo esc_url( Akismet_Admin::get_page_url() ); ?>"/>
<input type="hidden" name="blog" value="<?php echo esc_url( get_option( 'home' ) ); ?>"/>
<input type="hidden" name="user_id" value="<?php echo esc_attr( $akismet_user->ID ); ?>"/>
<input type="hidden" name="redirect" value="upgrade"/>
<input type="submit" class="button button-primary" value="<?php esc_attr_e( 'Reactivate Akismet' , 'akismet'); ?>"/>
</form>
</div>
<?php elseif ( $akismet_user->status == 'suspended' ) : ?>
<p><?php esc_html_e('Akismet eliminates spam from your site.', 'akismet'); ?></p>
<div class="activate-highlight centered activate-option">
<strong class="small-heading"><?php esc_html_e( 'Connected via Jetpack' , 'akismet'); ?></strong>
<h3 class="alert-text"><?php echo esc_html( sprintf( __( 'Your subscription for %s is suspended' , 'akismet'), $akismet_user->user_email ) ); ?></h3>
<p><?php esc_html_e('No worries! Get in touch and we&#8217;ll sort this out.', 'akismet'); ?></p>
<a href="https://akismet.com/contact" class="button button-primary"><?php esc_html_e( 'Contact Akismet support' , 'akismet'); ?></a>
</div>
<?php else : // ask do they want to use akismet account found using jetpack wpcom connection ?>
<p style="margin-right:10px"><?php esc_html_e('Akismet eliminates spam from your site. To set up Akismet, select one of the options below.', 'akismet'); ?></p>
<div class="activate-highlight activate-option">
<div class="option-description">
<strong class="small-heading"><?php esc_html_e('Connected via Jetpack', 'akismet'); ?></strong>
<?php echo esc_html( $akismet_user->user_email ); ?>
</div>
<form name="akismet_use_wpcom_key" action="<?php echo esc_url( Akismet_Admin::get_page_url() ); ?>" method="post" id="akismet-activate" class="right">
<input type="hidden" name="key" value="<?php echo esc_attr( $akismet_user->api_key );?>"/>
<input type="hidden" name="action" value="enter-key">
<?php wp_nonce_field( Akismet_Admin::NONCE ) ?>
<input type="submit" class="button button-primary" value="<?php esc_attr_e( 'Use this account' , 'akismet'); ?>"/>
</form>
</div>
<?php endif;?>
<div class="activate-highlight secondary activate-option">
<div class="option-description">
<strong><?php esc_html_e('Sign up for a plan with a different email address', 'akismet'); ?></strong>
<p><?php esc_html_e('Use this option to use Akismet independently of your Jetpack connection.', 'akismet'); ?></p>
</div>
<?php Akismet::view( 'get', array( 'text' => __( 'Sign up with a different email address' , 'akismet'), 'classes' => array( 'right', 'button', 'button-secondary' ) ) ); ?>
</div>
<div class="activate-highlight secondary activate-option">
<div class="option-description">
<strong><?php esc_html_e('Enter an API key', 'akismet'); ?></strong>
<p><?php esc_html_e('Already have your key? Enter it here.', 'akismet'); ?></p>
</div>
<form action="<?php echo esc_url( Akismet_Admin::get_page_url() ); ?>" method="post" id="akismet-enter-api-key" class="right">
<input id="key" name="key" type="text" size="15" value="" class="regular-text code">
<input type="hidden" name="action" value="enter-key">
<?php wp_nonce_field( Akismet_Admin::NONCE ) ?>
<input type="submit" name="submit" id="submit" class="button button-secondary" value="<?php esc_attr_e('Use this key', 'akismet');?>">
</form>
</div>
<?php else :?>
<p><?php esc_html_e('Akismet eliminates spam from your site. To set up Akismet, select one of the options below.', 'akismet'); ?></p>
<div class="activate-highlight activate-option">
<div class="option-description">
<strong><?php esc_html_e( 'Activate Akismet' , 'akismet');?></strong>
<p><?php esc_html_e('Log in or sign up now.', 'akismet'); ?></p>
</div>
<?php Akismet::view( 'get', array( 'text' => __( 'Get your API key' , 'akismet'), 'classes' => array( 'right', 'button', 'button-primary' ) ) ); ?>
</div>
<div class="activate-highlight secondary activate-option">
<div class="option-description">
<strong><?php esc_html_e('Manually enter an API key', 'akismet'); ?></strong>
<p><?php esc_html_e('If you already know your API key.', 'akismet'); ?></p>
</div>
<form action="<?php echo esc_url( Akismet_Admin::get_page_url() ); ?>" method="post" id="akismet-enter-api-key" class="right">
<input id="key" name="key" type="text" size="15" value="<?php echo esc_attr( Akismet::get_api_key() ); ?>" class="regular-text code">
<input type="hidden" name="action" value="enter-key">
<?php wp_nonce_field( Akismet_Admin::NONCE ); ?>
<input type="submit" name="submit" id="submit" class="button button-secondary" value="<?php esc_attr_e('Use this key', 'akismet');?>">
</form>
</div><?php
endif;?>
</div>

@ -0,0 +1,4 @@
<div class="wrap">
<h2><?php esc_html_e( 'Akismet Stats' , 'akismet');?><?php if ( !isset( $hide_settings_link ) ): ?> <a href="<?php echo esc_url( Akismet_Admin::get_page_url() );?>" class="add-new-h2"><?php esc_html_e( 'Settings' , 'akismet');?></a><?php endif;?></h2>
<iframe src="<?php echo esc_url( sprintf( '//akismet.com/web/1.0/user-stats.php?blog=%s&api_key=%s&locale=%s', urlencode( get_option( 'home' ) ), Akismet::get_api_key(), get_locale() ) ); ?>" width="100%" height="2500px" frameborder="0" id="akismet-stats-frame"></iframe>
</div>

@ -0,0 +1,17 @@
<fieldset>
<legend class="screen-reader-text">
<span><?php esc_html_e( 'Akismet anti-spam strictness', 'akismet' ); ?></span>
</legend>
<p>
<label for="akismet_strictness_1">
<input type="radio" name="akismet_strictness" id="akismet_strictness_1" value="1" <?php checked( '1', get_option( 'akismet_strictness' ) ); ?> />
<?php esc_html_e( 'Strict: silently discard the worst and most pervasive spam.', 'akismet' ); ?>
</label>
</p>
<p>
<label for="akismet_strictness_0">
<input type="radio" name="akismet_strictness" id="akismet_strictness_0" value="0" <?php checked( '0', get_option( 'akismet_strictness' ) ); ?> />
<?php esc_html_e( 'Safe: always put spam in the Spam folder for review.', 'akismet' ); ?>
</label>
</p>
</fieldset>

@ -0,0 +1,213 @@
<?php
global $wpcom_api_key, $akismet_api_host, $akismet_api_port;
$wpcom_api_key = defined( 'WPCOM_API_KEY' ) ? constant( 'WPCOM_API_KEY' ) : '';
$akismet_api_host = Akismet::get_api_key() . '.rest.akismet.com';
$akismet_api_port = 80;
function akismet_test_mode() {
return Akismet::is_test_mode();
}
function akismet_http_post( $request, $host, $path, $port = 80, $ip = null ) {
$path = str_replace( '/1.1/', '', $path );
return Akismet::http_post( $request, $path, $ip );
}
function akismet_microtime() {
return Akismet::_get_microtime();
}
function akismet_delete_old() {
return Akismet::delete_old_comments();
}
function akismet_delete_old_metadata() {
return Akismet::delete_old_comments_meta();
}
function akismet_check_db_comment( $id, $recheck_reason = 'recheck_queue' ) {
return Akismet::check_db_comment( $id, $recheck_reason );
}
function akismet_rightnow() {
if ( !class_exists( 'Akismet_Admin' ) )
return false;
return Akismet_Admin::rightnow_stats();
}
function akismet_admin_init() {
_deprecated_function( __FUNCTION__, '3.0' );
}
function akismet_version_warning() {
_deprecated_function( __FUNCTION__, '3.0' );
}
function akismet_load_js_and_css() {
_deprecated_function( __FUNCTION__, '3.0' );
}
function akismet_nonce_field( $action = -1 ) {
return wp_nonce_field( $action );
}
function akismet_plugin_action_links( $links, $file ) {
return Akismet_Admin::plugin_action_links( $links, $file );
}
function akismet_conf() {
_deprecated_function( __FUNCTION__, '3.0' );
}
function akismet_stats_display() {
_deprecated_function( __FUNCTION__, '3.0' );
}
function akismet_stats() {
return Akismet_Admin::dashboard_stats();
}
function akismet_admin_warnings() {
_deprecated_function( __FUNCTION__, '3.0' );
}
function akismet_comment_row_action( $a, $comment ) {
return Akismet_Admin::comment_row_actions( $a, $comment );
}
function akismet_comment_status_meta_box( $comment ) {
return Akismet_Admin::comment_status_meta_box( $comment );
}
function akismet_comments_columns( $columns ) {
_deprecated_function( __FUNCTION__, '3.0' );
return $columns;
}
function akismet_comment_column_row( $column, $comment_id ) {
_deprecated_function( __FUNCTION__, '3.0' );
}
function akismet_text_add_link_callback( $m ) {
return Akismet_Admin::text_add_link_callback( $m );
}
function akismet_text_add_link_class( $comment_text ) {
return Akismet_Admin::text_add_link_class( $comment_text );
}
function akismet_check_for_spam_button( $comment_status ) {
return Akismet_Admin::check_for_spam_button( $comment_status );
}
function akismet_submit_nonspam_comment( $comment_id ) {
return Akismet::submit_nonspam_comment( $comment_id );
}
function akismet_submit_spam_comment( $comment_id ) {
return Akismet::submit_spam_comment( $comment_id );
}
function akismet_transition_comment_status( $new_status, $old_status, $comment ) {
return Akismet::transition_comment_status( $new_status, $old_status, $comment );
}
function akismet_spam_count( $type = false ) {
return Akismet_Admin::get_spam_count( $type );
}
function akismet_recheck_queue() {
return Akismet_Admin::recheck_queue();
}
function akismet_remove_comment_author_url() {
return Akismet_Admin::remove_comment_author_url();
}
function akismet_add_comment_author_url() {
return Akismet_Admin::add_comment_author_url();
}
function akismet_check_server_connectivity() {
return Akismet_Admin::check_server_connectivity();
}
function akismet_get_server_connectivity( $cache_timeout = 86400 ) {
return Akismet_Admin::get_server_connectivity( $cache_timeout );
}
function akismet_server_connectivity_ok() {
_deprecated_function( __FUNCTION__, '3.0' );
return true;
}
function akismet_admin_menu() {
return Akismet_Admin::admin_menu();
}
function akismet_load_menu() {
return Akismet_Admin::load_menu();
}
function akismet_init() {
_deprecated_function( __FUNCTION__, '3.0' );
}
function akismet_get_key() {
return Akismet::get_api_key();
}
function akismet_check_key_status( $key, $ip = null ) {
return Akismet::check_key_status( $key, $ip );
}
function akismet_update_alert( $response ) {
return Akismet::update_alert( $response );
}
function akismet_verify_key( $key, $ip = null ) {
return Akismet::verify_key( $key, $ip );
}
function akismet_get_user_roles( $user_id ) {
return Akismet::get_user_roles( $user_id );
}
function akismet_result_spam( $approved ) {
return Akismet::comment_is_spam( $approved );
}
function akismet_result_hold( $approved ) {
return Akismet::comment_needs_moderation( $approved );
}
function akismet_get_user_comments_approved( $user_id, $comment_author_email, $comment_author, $comment_author_url ) {
return Akismet::get_user_comments_approved( $user_id, $comment_author_email, $comment_author, $comment_author_url );
}
function akismet_update_comment_history( $comment_id, $message, $event = null ) {
return Akismet::update_comment_history( $comment_id, $message, $event );
}
function akismet_get_comment_history( $comment_id ) {
return Akismet::get_comment_history( $comment_id );
}
function akismet_cmp_time( $a, $b ) {
return Akismet::_cmp_time( $a, $b );
}
function akismet_auto_check_update_meta( $id, $comment ) {
return Akismet::auto_check_update_meta( $id, $comment );
}
function akismet_auto_check_comment( $commentdata ) {
return Akismet::auto_check_comment( $commentdata );
}
function akismet_get_ip_address() {
return Akismet::get_ip_address();
}
function akismet_cron_recheck() {
return Akismet::cron_recheck();
}
function akismet_add_comment_nonce() {
return Akismet::add_comment_nonce( $post_id );
}
function akismet_fix_scheduled_recheck() {
return Akismet::fix_scheduled_recheck();
}
function akismet_spam_comments() {
_deprecated_function( __FUNCTION__, '3.0' );
return array();
}
function akismet_spam_totals() {
_deprecated_function( __FUNCTION__, '3.0' );
return array();
}
function akismet_manage_page() {
_deprecated_function( __FUNCTION__, '3.0' );
}
function akismet_caught() {
_deprecated_function( __FUNCTION__, '3.0' );
}
function redirect_old_akismet_urls() {
_deprecated_function( __FUNCTION__, '3.0' );
}
function akismet_kill_proxy_check( $option ) {
_deprecated_function( __FUNCTION__, '3.0' );
return 0;
}
function akismet_pingback_forwarded_for( $r, $url ) {
return Akismet::pingback_forwarded_for( $r, $url );
}
function akismet_pre_check_pingback( $method ) {
return Akismet::pre_check_pingback( $method );
}

File diff suppressed because it is too large Load Diff

@ -0,0 +1,208 @@
<?php
/**
* The Module Manager.
*
* Mostly we're activating and deactivating modules/features.
*
* @package All-in-One-SEO-Pack
* @since 2.0
*/
if ( ! class_exists( 'All_in_One_SEO_Pack_Module_Manager' ) ) {
/**
* Class All_in_One_SEO_Pack_Module_Manager
*/
class All_in_One_SEO_Pack_Module_Manager {
protected $modules = array();
protected $settings_update = false;
protected $settings_reset = false;
protected $settings_reset_all = false;
protected $module_settings_update = false;
/**
* All_in_One_SEO_Pack_Module_Manager constructor.
*
* Initialize module list.
*
* @param $mod Modules.
*/
function __construct( $mod ) {
$this->modules['feature_manager'] = null;
foreach ( $mod as $m ) {
$this->modules[ $m ] = null;
}
$reset = false;
$reset_all = ( isset( $_POST['Submit_All_Default'] ) && '' !== $_POST['Submit_All_Default'] );
$reset = ( ( isset( $_POST['Submit_Default'] ) && '' !== $_POST['Submit_Default'] ) || $reset_all );
$update = ( isset( $_POST['action'] ) && $_POST['action']
&& ( ( isset( $_POST['Submit'] ) && '' !== $_POST['Submit'] ) || $reset )
);
if ( $update ) {
if ( $reset ) {
$this->settings_reset = true;
}
if ( $reset_all ) {
$this->settings_reset_all = true;
}
if ( 'aiosp_update' === $_POST['action'] ) {
$this->settings_update = true;
}
if ( 'aiosp_update_module' === $_POST['action'] ) {
$this->module_settings_update = true;
}
}
$this->do_load_module( 'feature_manager', $mod );
}
/**
* Return module.
*
* @param $class
*
* @return $this|bool|mixed
*/
function return_module( $class ) {
global $aiosp;
if ( get_class( $aiosp ) === $class ) {
return $aiosp;
}
if ( get_class( $aiosp ) === $class ) {
return $this;
}
foreach ( $this->modules as $m ) {
if ( is_object( $m ) && ( get_class( $m ) === $class ) ) {
return $m;
}
}
return false;
}
/**
* @return array
*/
function get_loaded_module_list() {
$module_list = array();
if ( ! empty( $this->modules ) ) {
foreach ( $this->modules as $k => $v ) {
if ( ! empty( $v ) ) {
$module_list[ $k ] = get_class( $v );
}
}
}
return $module_list;
}
/**
* @param $mod Module.
* @param null $args
*
* @return bool
*/
function do_load_module( $mod, $args = null ) {
// Module name is used for these automatic settings:
// The aiosp_enable_$module settings - whether each plugin is active or not.
// The name of the .php file containing the module - aioseop_$module.php.
// The name of the class - All_in_One_SEO_Pack_$Module.
// The global $aioseop_$module.
// $this->modules[$module].
$mod_path = apply_filters( "aioseop_include_$mod", AIOSEOP_PLUGIN_DIR . "modules/aioseop_$mod.php" );
if ( ! empty( $mod_path ) ) {
require_once( $mod_path );
}
$ref = "aioseop_$mod";
$classname = 'All_in_One_SEO_Pack_' . strtr( ucwords( strtr( $mod, '_', ' ' ) ), ' ', '_' );
$classname = apply_filters( "aioseop_class_$mod", $classname );
$module_class = new $classname( $args );
$GLOBALS[ $ref ] = $module_class;
$this->modules[ $mod ] = $module_class;
if ( is_user_logged_in() && is_admin_bar_showing() && current_user_can( 'aiosp_manage_seo' ) ) {
add_action( 'admin_bar_menu', array(
$module_class,
'add_admin_bar_submenu',
), 1001 + $module_class->menu_order() );
}
if ( is_admin() ) {
add_action( 'aioseop_modules_add_menus', array(
$module_class,
'add_menu',
), $module_class->menu_order() );
add_action( 'aiosoep_options_reset', array( $module_class, 'reset_options' ) );
add_filter( 'aioseop_export_settings', array( $module_class, 'settings_export' ) );
}
return true;
}
/**
* @param $mod
*
* @return bool
*/
function load_module( $mod ) {
static $feature_options = null;
static $feature_prefix = null;
if ( ! is_array( $this->modules ) ) {
return false;
}
$v = $this->modules[ $mod ];
if ( null !== $v ) {
return false;
} // Already loaded.
if ( 'performance' === $mod && ! is_super_admin() ) {
return false;
}
if ( ( 'file_editor' === $mod || 'robots' === $mod )
&& ( ( defined( 'DISALLOW_FILE_EDIT' ) && DISALLOW_FILE_EDIT )
|| ( defined( 'DISALLOW_FILE_MODS' ) && DISALLOW_FILE_MODS )
|| ! is_super_admin() )
) {
return false;
}
$mod_enable = false;
$fm_page = ( $this->module_settings_update && wp_verify_nonce( $_POST['nonce-aioseop'], 'aioseop-nonce' ) &&
isset( $_REQUEST['page'] ) && trailingslashit( AIOSEOP_PLUGIN_DIRNAME ) . 'modules/aioseop_feature_manager.php' === $_REQUEST['page'] );
if ( $fm_page && ! $this->settings_reset ) {
if ( isset( $_POST["aiosp_feature_manager_enable_$mod"] ) ) {
$mod_enable = $_POST["aiosp_feature_manager_enable_$mod"];
} else {
$mod_enable = false;
}
} else {
if ( null === $feature_prefix ) {
$feature_prefix = $this->modules['feature_manager']->get_prefix();
}
if ( $fm_page && $this->settings_reset ) {
$feature_options = $this->modules['feature_manager']->default_options();
}
if ( null === $feature_options ) {
if ( $this->module_settings_update && $this->settings_reset_all && wp_verify_nonce( $_POST['nonce-aioseop'], 'aioseop-nonce' ) ) {
$feature_options = $this->modules['feature_manager']->default_options();
} else {
$feature_options = $this->modules['feature_manager']->get_current_options();
}
}
if ( isset( $feature_options["{$feature_prefix}enable_$mod"] ) ) {
$mod_enable = $feature_options["{$feature_prefix}enable_$mod"];
}
}
if ( $mod_enable ) {
return $this->do_load_module( $mod );
}
return false;
}
function load_modules() {
if ( is_array( $this->modules ) ) {
foreach ( $this->modules as $k => $v ) {
$this->load_module( $k );
}
}
}
}
}

@ -0,0 +1,107 @@
<div class="wrap credits-wrap">
<p class="about-description"><?php _e( 'All in One SEO Pack is created by a worldwide network of friendly folks like these.', 'all-in-one-seo-pack' ); ?></p>
<h3 class="wp-people-group"><?php _e( 'Project Leaders', 'all-in-one-seo-pack' ); ?></h3>
<ul class="wp-people-group " id="wp-people-group-project-leaders">
<li class="wp-person" id="wp-person-michaeltorbert">
<a class="web" href="https://profiles.wordpress.org/hallsofmontezuma" target="_blank"><img alt="" class="gravatar" src="https://s.gravatar.com/avatar/f41419cf5cfdbb071a8d591ac9976bf3?s=60">
Michael Torbert</a>
<span class="title"><?php _e( 'Project Lead', 'all-in-one-seo-pack' ); ?></span>
</li>
<li class="wp-person" id="wp-person-stevemortiboy">
<a class="web" target="_blank" href="https://profiles.wordpress.org/wpsmort"><img alt="" class="gravatar" src="https://www.gravatar.com/avatar/40e33d813c16a63500675d851b0cbf3a?s=60">
Steve Mortiboy</a>
<span class="title"><?php _e( 'Project Manager', 'all-in-one-seo-pack' ); ?></span>
</li>
</ul>
<h3 class="wp-people-group"><?php printf( _e( 'Core Team', 'all-in-one-seo-pack' ) ); ?></h3>
<ul class="wp-people-group " id="wp-people-group-contributors">
<li class="wp-person" id="wp-person-arnaudbroes">
<a class="web" target="_blank" href="https://profiles.wordpress.org/arnaudbroes"><img alt="" class="gravatar" src="https://www.gravatar.com/avatar/0ce0d554c2b0bd61d326e15c8dcde756?s=60">
Arnaud Broes</a>
<span class="title"><?php _e( 'Development Team', 'all-in-one-seo-pack' ); ?></span>
</li>
<li class="wp-person" id="wp-person-yuqianliu">
<a class="web" target="_blank" href="https://profiles.wordpress.org/yuqianl"><img alt="" class="gravatar" src="https://www.gravatar.com/avatar/8f971bea2b6c483fd1099e558013a7d0?s=60">
Yuqian Liu</a>
<span class="title"><?php _e( 'Development Team', 'all-in-one-seo-pack' ); ?></span>
</li>
<li class="wp-person" id="wp-person-aaronbrodney">
<a class="web" target="_blank" href="https://github.com/theycalledmetaz"><img alt="" class="gravatar" src="https://avatars3.githubusercontent.com/u/8225725?v=3&s=60">
Aaron Brodney</a>
<span class="title"><?php _e( 'Development Team', 'all-in-one-seo-pack' ); ?></span>
</li>
</ul>
<h3 class="wp-people-group">&#x1f31f;<?php _e( 'Recent Rockstar Contributors', 'all-in-one-seo-pack' ); ?>&#x1f31f;</h3>
<ul class="wp-people-group " id="wp-people-group-rockstars">
<li><?php printf( __('Want to see your name and picture here as a community developer? Open a new issue on Github to report a bug or request a feature or find an issue and submit code!')); ?>
<a href="https://github.com/semperfiwebdesign/all-in-one-seo-pack" target="_blank">Click here to go to Github</a>
</li>
<li class="wp-person" id="wp-person-dougalcampbell">
<a class="web" target="_blank" href="https://profiles.wordpress.org/dougal/"><img alt="" class="gravatar" src="https://www.gravatar.com/avatar/81717a172b6918071fbea1a52483294b?s=60">
Dougal Campbell</a>
</li>
<li class="wp-person" id="wp-person-alejandromostajo">
<a class="web" target="_blank" href="https://github.com/amostajo"><img alt="" class="gravatar" src="https://avatars1.githubusercontent.com/u/1645908?s=60">
Alejandro Mostajo</a>
</li>
<li class="wp-person" id="joelrd">
<a class="web" target="_blank" href="https://github.com/joelrd"><img alt="" class="gravatar" src="https://avatars0.githubusercontent.com/u/16063717?s=60">
Joelrd</a>
</li>
<li class="wp-person" id="carlalexander">
<a class="web" target="_blank" href="https://profiles.wordpress.org/carlalexander/"><img alt="" class="gravatar" src="https://secure.gravatar.com/avatar/5a4758faa5ba6c1322bdfb0f6ebcf56c?s=60">
Carl Alexander</a>
</li>
</ul>
<h3 class="wp-people-group dashicons-before dashicons-translation"><?php printf( _e( 'Translation contributors and translation editors', 'all-in-one-seo-pack' ), '1.2' ); ?></h3>
<p class="wp-credits-list">
<a href="https://profiles.wordpress.org/pierrelannoy/" target="_blank">Pierre Lannoy</a>,
<a href="https://profiles.wordpress.org/sonjanyc/" target="_blank">Sonja Leix</a>,
<a href="https://profiles.wordpress.org/dev-ide/" target="_blank">Adil El hallaoui</a>,
<a href="https://profiles.wordpress.org/simonie/" target="_blank">simonie</a>,
<a href="https://profiles.wordpress.org/lenasterg/" target="_blank">lenasterg</a>,
<a href="https://profiles.wordpress.org/arnaudbroes/" target="_blank">Arnaud Broes</a>,
<a href="https://profiles.wordpress.org/pixolin/" target="_blank">Bego Mario Garde</a>,
<a href="https://profiles.wordpress.org/wp-yogi/" target="_blank">wp-yogi</a>,
<a href="https://profiles.wordpress.org/wpsmort/" target="_blank">Steve Mortiboy</a>,
<a href="https://profiles.wordpress.org/webaware/" target="_blank">webaware</a>,
<a href="https://profiles.wordpress.org/escribirelmundo/" target="_blank">escribirelmundo</a>,
<a href="https://profiles.wordpress.org/casiepa/" target="_blank">Pascal Casier</a>,
<a href="https://profiles.wordpress.org/nurron/" target="_blank">Nurron Shodiqin</a>,
<a href="https://profiles.wordpress.org/aprmndr/" target="_blank">Alyssa Primandaru</a>,
<a href="https://profiles.wordpress.org/facestoro/" target="_blank">facestoro</a>,
<a href="https://profiles.wordpress.org/yuqianl/" target="_blank">Dawa Torbert</a>,
<a href="https://profiles.wordpress.org/hallsofmontezuma/" target="_blank">Michael Torbert</a>,
<a href="https://profiles.wordpress.org/istvanzseller/" target="_blank">Istvan Zseller</a>,
<a href="https://profiles.wordpress.org/paaljoachim" target="_blank">Paal Joachim Romdahl</a>,
<a href="https://profiles.wordpress.org/almaz/" target="_blank">Almaz Mannanov</a>,
<a href="https://profiles.wordpress.org/vide13 /" target="_blank">vide13</a>,
<a href="https://profiles.wordpress.org/yuraz/" target="_blank">Jurica Zuanovic</a>,
<a href="https://profiles.wordpress.org/arhipaiva/" target="_blank">arhipaiva</a>,
<a href="https://profiles.wordpress.org/maximanikin/" target="_blank">Maxim Anikin</a>,
<a href="https://profiles.wordpress.org/petya/" target="_blank">Petya Raykovska</a>,
<a href="https://profiles.wordpress.org/hathanh0809/" target="_blank">hathanh0809</a>,
<a href="https://profiles.wordpress.org/cedric3131/" target="_blank">Cédric Valmary</a>,
<a href="https://profiles.wordpress.org/smitka/" target="_blank">Vladimir Smitka</a>,
<a href="https://profiles.wordpress.org/brewtal/" target="_blank">Paul P.</a>,
<a href="https://profiles.wordpress.org/wpaleks/" target="_blank">Aleksander Savkovic</a>,
<a href="https://profiles.wordpress.org/diogosanches/" target="_blank">Diogo Sanches</a>,
<a href="https://profiles.wordpress.org/klemenfajs/" target="_blank">Klemen Fajs</a>,
<a href="https://profiles.wordpress.org/adriancastellanos/" target="_blank">Adrian Castellanos</a>,
<a href="https://profiles.wordpress.org/exilhamburger/" target="_blank">exilhamburger</a>,
<a href="https://profiles.wordpress.org/garyj/" target="_blank">Gary Jones</a>,
<a href="https://profiles.wordpress.org/fernandot/" target="_blank">Fernando Tellado</a>,
<a href="https://profiles.wordpress.org/hiwhatsup/" target="_blank">Carlos Zuniga</a>,
<a href="https://profiles.wordpress.org/fxbenard/" target="_blank">François Bernard</a>,
<a href="https://profiles.wordpress.org/jack0falltrades/" target="_blank">jack0falltrades</a>,
<a href="https://profiles.wordpress.org/dancaragea/" target="_blank">Dan Caragea</a>,
<a href="https://profiles.wordpress.org/kyla81975/" target="_blank">kyla81975</a>,
<a href="https://profiles.wordpress.org/arildknudsen1/" target="_blank">Arild Knudsen</a>.
</p>
</div>

@ -0,0 +1,121 @@
<?php
if ( ! class_exists( 'aioseop_dashboard_widget' ) ) {
/**
* Class aioseop_dashboard_widget
*
* @since 2.3.10
*/
class aioseop_dashboard_widget {
/**
* Add the action to the constructor.
*/
function __construct() {
add_action( "wp_dashboard_setup", array( $this, 'aioseop_add_dashboard_widget' ) );
}
/**
* @since 2.3.10
*/
function aioseop_add_dashboard_widget() {
if ( current_user_can( 'install_plugins' ) && false !== $this->show_widget() ) {
wp_add_dashboard_widget( "semperplugins-rss-feed", __( 'SEO News', 'all-in-one-seo-pack' ), array(
$this,
'aioseop_display_rss_dashboard_widget',
) );
}
}
/**
* @since 2.3.10.2
*/
function show_widget() {
$show = true;
if ( apply_filters( 'aioseo_show_seo_news', true ) === false ) {
// API filter hook to disable showing SEO News dashboard widget.
return false;
}
global $aioseop_options;
if ( AIOSEOPPRO && isset( $aioseop_options['aiosp_showseonews'] ) && ! $aioseop_options['aiosp_showseonews'] ) {
return false;
}
return $show;
}
/**
* @since 2.3.10
*/
function aioseop_display_rss_dashboard_widget() {
include_once( ABSPATH . WPINC . "/feed.php" );
if ( false === ( $rss_items = get_transient( 'aioseop_feed' ) ) ) {
$rss = fetch_feed( "https://www.semperplugins.com/feed/" );
if ( is_wp_error( $rss ) ) {
echo '{Temporarily unable to load feed.}';
return;
}
$rss_items = $rss->get_items( 0, 4 ); // Show four items.
$cached = array();
foreach ( $rss_items as $item ) {
$cached[] = array(
'url' => $item->get_permalink(),
'title' => $item->get_title(),
'date' => $item->get_date( "M jS Y" ),
'content' => substr( strip_tags( $item->get_content() ), 0, 128 ) . "...",
);
}
$rss_items = $cached;
set_transient( 'aioseop_feed', $cached, 12 * HOUR_IN_SECONDS );
}
?>
<ul>
<?php
if ( false === $rss_items ) {
echo "<li>No items</li>";
return;
}
foreach ( $rss_items as $item ) {
?>
<li>
<a target="_blank" href="<?php echo esc_url( $item['url'] ); ?>">
<?php echo esc_html( $item['title'] ); ?>
</a>
<span class="aioseop-rss-date"><?php echo $item['date']; ?></span>
<div class="aioseop_news">
<?php echo strip_tags( $item['content'] ) . "..."; ?>
</div>
</li>
<?php
}
?>
</ul>
<?php
}
}
new aioseop_dashboard_widget();
}

@ -0,0 +1,168 @@
<?php
/**
* @package All-in-One-SEO-Pack
*/
class aiosp_metaboxes {
/**
* aiosp_metaboxes constructor.
*/
function __construct() {
//construct
}
/**
* @param $add
* @param $meta
*/
static function display_extra_metaboxes( $add, $meta ) {
echo "<div class='aioseop_metabox_wrapper' >";
switch ( $meta['id'] ) {
case 'aioseop-about':
?>
<div class="aioseop_metabox_text">
<p><h2
style="display:inline;"><?php echo AIOSEOP_PLUGIN_NAME; ?></h2></p>
<?php
global $current_user;
$user_id = $current_user->ID;
$ignore = get_user_meta( $user_id, 'aioseop_ignore_notice' );
if ( ! empty( $ignore ) ) {
$qa = Array();
wp_parse_str( $_SERVER['QUERY_STRING'], $qa );
$qa['aioseop_reset_notices'] = 1;
$url = '?' . build_query( $qa );
echo '<p><a href="' . $url . '">' . __( 'Reset Dismissed Notices', 'all-in-one-seo-pack' ) . '</a></p>';
}
if ( ! AIOSEOPPRO ) {
?>
<p>
<strong><?php echo aiosp_common::get_upgrade_hyperlink( 'side', __( 'Pro Version', 'all-in-one-seo-pack' ), __( 'CLICK HERE', 'all-in-one-seo-pack' ), '_blank' ); ?> to upgrade to Pro Version and get:</strong>
</p>
<?php } ?>
</div>
<?php
case 'aioseop-donate':
?>
<div>
<?php if ( ! AIOSEOPPRO ) { ?>
<div class="aioseop_metabox_text">
<p>
<?php self::pro_meta_content(); ?>
</p>
</div>
<?php } ?>
<div class="aioseop_metabox_feature">
<div class="aiosp-di">
<a class="dashicons di-twitter" target="_blank" href="https://twitter.com/aioseopack" title="Follow me on Twitter"></a>
<a class="dashicons di-facebook" target="_blank" href="https://www.facebook.com/aioseopack" title="Follow me on Facebook"></a>
</div>
</div><?php
$aiosp_trans = new AIOSEOP_Translations();
// Eventually if nothing is returned we should just remove this section.
if ( get_locale() != 'en_US' ) { ?>
<div><strong>
<?php
if ( $aiosp_trans->percent_translated < 100 ) {
/* translators: %1$s expands to the number of languages All in One SEO Pack has been translated into. $2%s to the percentage translated of the current language, $3%s to the language name, %4$s and %5$s to anchor tags with link to translation page at translate.wordpress.org */
printf( __(
'All in One SEO Pack has been translated into %1$s languages, but currently the %3$s translation is only %2$s percent complete. %4$s Click here %5$s to help get it to 100 percent.', 'all-in-one-seo-pack' ),
$aiosp_trans->translated_count,
$aiosp_trans->percent_translated,
$aiosp_trans->name,
"<a href=\"$aiosp_trans->translation_url\" target=\"_BLANK\">",
'</a>' );
}
?>
</strong></div>
<?php } ?>
</div>
<?php
break;
case 'aioseop-list':
?>
<div class="aioseop_metabox_text">
<form
action="https://semperfiwebdesign.us1.list-manage.com/subscribe/post?u=794674d3d54fdd912f961ef14&amp;id=af0a96d3d9"
method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate"
target="_blank">
<h2><?php _e( 'Join our mailing list for tips, tricks, and WordPress secrets.', 'all-in-one-seo-pack' ); ?></h2>
<p>
<i><?php _e( 'Sign up today and receive a free copy of the e-book 5 SEO Tips for WordPress ($39 value).', 'all-in-one-seo-pack' ); ?></i>
</p>
<p><input type="text" value="" name="EMAIL" class="required email" id="mce-EMAIL"
placeholder="Email Address">
<input type="submit" value="Subscribe" name="subscribe" id="mc-embedded-subscribe"
class="btn"></p>
</form>
</div>
<?php
break;
case 'aioseop-support':
?>
<div class="aioseop_metabox_text">
<p>
<div class="aioseop_icon aioseop_file_icon"></div>
<a target="_blank"
href="https://semperplugins.com/documentation/"><?php _e( 'Read the All in One SEO Pack user guide', 'all-in-one-seo-pack' ); ?></a></p>
<p>
<div class="aioseop_icon aioseop_support_icon"></div>
<a target="_blank"
title="<?php _e( 'All in One SEO Pro Plugin Support Forum', 'all-in-one-seo-pack' ); ?>"
href="https://semperplugins.com/support/"><?php _e( 'Access our Premium Support Forums', 'all-in-one-seo-pack' ); ?></a></p>
<p>
<div class="aioseop_icon aioseop_cog_icon"></div>
<a target="_blank" title="<?php _e( 'All in One SEO Pro Plugin Changelog', 'all-in-one-seo-pack' ); ?>"
href="<?php if ( AIOSEOPPRO ) {
echo 'https://semperplugins.com/documentation/all-in-one-seo-pack-pro-changelog/';
} else {
echo 'https://semperfiwebdesign.com/blog/all-in-one-seo-pack/all-in-one-seo-pack-release-history/';
} ?>"><?php _e( 'View the Changelog', 'all-in-one-seo-pack' ); ?></a></p>
<p>
<div class="aioseop_icon aioseop_youtube_icon"></div>
<a target="_blank"
href="https://semperplugins.com/doc-type/video/"><?php _e( 'Watch video tutorials', 'all-in-one-seo-pack' ); ?></a></p>
<p>
<div class="aioseop_icon aioseop_book_icon"></div>
<a target="_blank"
href="https://semperplugins.com/documentation/quick-start-guide/"><?php _e( 'Getting started? Read the Beginners Guide', 'all-in-one-seo-pack' ); ?></a></p>
</div>
<?php
break;
}
echo '</div>';
}
static function pro_meta_content() {
echo '<ul>';
if ( class_exists( 'WooCommerce' ) ) {
echo '<li>Advanced support for WooCommerce</li>';
}else{
echo '<li>Advanced support for e-commerce</li>';
}
echo '<li>Video SEO Module</li>';
echo '<li>SEO for Categories, Tags and Custom Taxonomies</li>';
echo '<li>Access to Video Screencasts</li>';
echo '<li>Access to Premium Support Forums</li>';
echo '<li>Access to Knowledge Center</li>';
echo '</ul>';
}
}

@ -0,0 +1,4 @@
<?php
/**
* Silence is golden.
*/

@ -0,0 +1,3 @@
<?php
// We will eventually put stuff here.

@ -0,0 +1,67 @@
<div id="welcome-panel" class="">
<div class="welcome-panel-content">
<div class="welcome-panel-column-container">
<div class="welcome-panel-column">
<h3><?php echo esc_html( __( 'Support All in One SEO Pack', 'all-in-one-seo-pack' ) ); ?></h3>
<p class="message"><?php echo esc_html( __( 'There are many ways you can help support All in One SEO Pack.', 'all-in-one-seo-pack' ) ); ?></p>
<p class="message aioseop-message"><?php echo esc_html( __( 'Upgrade to All in One SEO Pack Pro to access priority support and premium features.', 'all-in-one-seo-pack' ) ); ?></p>
<p class="call-to-action"><a
href="https://semperplugins.com/all-in-one-seo-pack-pro-version/?loc=aio_welcome"
target="_blank"
class="button button-primary button-orange"><?php echo __( 'Upgrade', 'all-in-one-seo-pack' ); ?></a>
</p>
<p class="message aioseop-message"><?php echo esc_html( __( 'Help translate All in One SEO Pack into your language.', 'all-in-one-seo-pack' ) ); ?></p>
<p class="call-to-action"><a
href="https://translate.wordpress.org/projects/wp-plugins/all-in-one-seo-pack"
class="button button-primary"
target="_blank"><?php echo __( 'Translate', 'all-in-one-seo-pack' ); ?></a></p>
</div>
<div class="welcome-panel-column">
<h3><?php echo esc_html( __( 'Get Started', 'all-in-one-seo-pack' ) ); ?></h3>
<ul>
<li><a href="https://semperplugins.com/documentation/quick-start-guide/"
target="_blank"><?php echo __( 'Beginners Guide for All in One SEO Pack', 'all-in-one-seo-pack' ); ?></a>
</li>
<li><a href="https://semperplugins.com/documentation/beginners-guide-to-xml-sitemaps/"
target="_blank"><?php echo __( 'Beginners Guide for XML Sitemap module', 'all-in-one-seo-pack' ); ?></a>
</li>
<li><a href="https://semperplugins.com/documentation/beginners-guide-to-social-meta/"
target="_blank"><?php echo __( 'Beginners Guide for Social Meta module', 'all-in-one-seo-pack' ); ?></a>
</li>
<li><a href="https://semperplugins.com/documentation/top-tips-for-good-on-page-seo/"
target="_blank"><?php echo __( 'Tips for good on-page SEO', 'all-in-one-seo-pack' ); ?></a>
</li>
<li>
<a href="https://semperplugins.com/documentation/quality-guidelines-for-seo-titles-and-descriptions/"
target="_blank"><?php echo __( 'Quality guidelines for SEO titles and descriptions', 'all-in-one-seo-pack' ); ?></a>
</li>
<li><a href="https://semperplugins.com/documentation/submitting-an-xml-sitemap-to-google/"
target="_blank"><?php echo __( 'Submit an XML Sitemap to Google', 'all-in-one-seo-pack' ); ?></a>
</li>
<li><a href="https://semperplugins.com/documentation/setting-up-google-analytics/"
target="_blank"><?php echo __( 'Set up Google Analytics', 'all-in-one-seo-pack' ); ?></a>
</li>
</ul>
</div>
<div class="welcome-panel-column">
<h3><?php echo esc_html( __( 'Did You Know?', 'all-in-one-seo-pack' ) ); ?></h3>
<ul>
<li><a href="https://semperplugins.com/documentation/"
target="_blank"><?php echo __( 'We have complete documentation on every setting and feature', 'all-in-one-seo-pack' ); ?></a>
</li>
<li><a href="https://semperplugins.com/videos/"
target="_blank"><?php echo __( 'You can get access to video tutorials about SEO with the Pro version', 'all-in-one-seo-pack' ); ?></a>
</li>
<li><a href="https://semperplugins.com/all-in-one-seo-pack-pro-version/?loc=aio_welcome"
target="_blank"><?php echo __( 'You can control SEO on categories, tags and custom taxonomies with the Pro version', 'all-in-one-seo-pack' ); ?></a>
</li>
</ul>
</div>
</div>
</div>
<p>
<a href=" <?php echo get_admin_url( null, 'admin.php?page=' . AIOSEOP_PLUGIN_DIRNAME . '/aioseop_class.php' ); ?> "><?php _e( 'Continue to the General Settings', 'all-in-one-seo-pack' ); ?></a> &raquo;
</p>
</div>

@ -0,0 +1,137 @@
<?php
if ( ! class_exists( 'aioseop_welcome' ) ) {
/**
* Class aioseop_welcome
*/
class aioseop_welcome {
/**
* Constructor to add the actions.
*/
function __construct() {
if ( AIOSEOPPRO ) {
return;
}
add_action( 'admin_menu', array( $this, 'add_menus' ) );
add_action( 'admin_head', array( $this, 'remove_pages' ) );
add_action( 'admin_enqueue_scripts', array( $this, 'welcome_screen_assets' ) );
}
/**
* Enqueues style and script.
*
* @param $hook
*/
function welcome_screen_assets( $hook ) {
if ( 'dashboard_page_aioseop-about' === $hook ) {
wp_enqueue_style( 'aioseop_welcome_css', AIOSEOP_PLUGIN_URL . '/css/welcome.css' );
wp_enqueue_script( 'aioseop_welcome_js', AIOSEOP_PLUGIN_URL . '/js/welcome.js', array( 'jquery' ), AIOSEOP_VERSION, true );
}
}
/**
* Removes unneeded pages.
*/
function remove_pages() {
remove_submenu_page( 'index.php', 'aioseop-about' );
remove_submenu_page( 'index.php', 'aioseop-credits' );
}
/**
* Adds (hidden) menu.
*/
function add_menus() {
add_dashboard_page(
__( 'Welcome to All in One SEO Pack', 'all-in-one-seo-pack' ),
__( 'Welcome to All in One SEO Pack', 'all-in-one-seo-pack' ),
'manage_options',
'aioseop-about',
array( $this, 'about_screen' )
);
}
/**
* Initial stuff.
*
* @param bool $activate
*/
function init( $activate = false ) {
if ( AIOSEOPPRO ) {
return;
}
if ( ! is_admin() ) {
return;
}
// Bail if activating from network, or bulk
if ( is_network_admin() || isset( $_GET['activate-multi'] ) ) {
return;
}
if ( ! current_user_can( 'manage_options' ) ) {
return;
}
$seen = 0;
$seen = get_user_meta( get_current_user_id(), 'aioseop_seen_about_page', true );
if ( AIOSEOP_VERSION === get_user_meta( get_current_user_id(), 'aioseop_seen_about_page', true ) && true !== $activate ) {
return;
}
update_user_meta( get_current_user_id(), 'aioseop_seen_about_page', AIOSEOP_VERSION );
aiosp_common::clear_wpe_cache();
wp_safe_redirect( add_query_arg( array( 'page' => 'aioseop-about' ), admin_url( 'index.php' ) ) );
exit;
}
/**
* Outputs the about screen.
*/
function about_screen() {
aiosp_common::clear_wpe_cache();
$version = AIOSEOP_VERSION;
?>
<div class="wrap about-wrap">
<h1><?php printf( esc_html__( 'Welcome to All in One SEO Pack %s', 'all-in-one-seo-pack' ), $version ); ?></h1>
<div
class="about-text"><?php printf( esc_html__( 'All in One SEO Pack %s contains new features, bug fixes, increased security, and tons of under the hood performance improvements.', 'all-in-one-seo-pack' ), $version ); ?></div>
<h2 class="nav-tab-wrapper">
<a class="nav-tab nav-tab-active" id="aioseop-about"
href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'aioseop-about' ), 'index.php' ) ) ); ?>">
<?php esc_html_e( 'What&#8217;s New', 'all-in-one-seo-pack' ); ?>
</a>
<a class="nav-tab" id="aioseop-credits"
href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'aioseop-credits' ), 'index.php' ) ) ); ?>">
<?php esc_html_e( 'Credits', 'all-in-one-seo-pack' ); ?>
</a>
</h2>
<div id='sections'>
<section><?php include_once( AIOSEOP_PLUGIN_DIR . 'admin/display/welcome-content.php' ); ?></section>
<section><?php include_once( AIOSEOP_PLUGIN_DIR . 'admin/display/credits-content.php' ); ?></section>
</div>
</div>
<?php
}
}
}

@ -0,0 +1,4 @@
<?php
/**
* Silence is golden.
*/

@ -0,0 +1,612 @@
<?php
if ( class_exists( 'WPSEO_Import_Hooks' ) ) {
/**
* Class WPSEO_Import_AIOSEO_Hooks
*
* @TODO Move this elsewhere.
*/
class WPSEO_Import_AIOSEO_Hooks extends WPSEO_Import_Hooks {
protected $plugin_file = 'all-in-one-seo-pack/all_in_one_seo_pack.php';
protected $deactivation_listener = 'deactivate_aioseo';
/**
* Show notice the old plugin is installed and offer to import its data.
*/
public function show_import_settings_notice() {
$yoasturl = add_query_arg( array( '_wpnonce' => wp_create_nonce( 'wpseo-import' ) ), admin_url( 'admin.php?page=wpseo_tools&tool=import-export&import=1&importaioseo=1#top#import-seo' ) );
$aiourl = add_query_arg( array( '_wpnonce' => wp_create_nonce( 'aiosp-import' ) ), admin_url( 'tools.php?page=aiosp_import' ) );
$aioseop_yst_detected_notice_dismissed = get_user_meta( get_current_user_id(), 'aioseop_yst_detected_notice_dismissed', true );
if ( empty( $aioseop_yst_detected_notice_dismissed ) ) {
echo '<div class="notice notice-warning row-title is-dismissible yst_notice"><p>', sprintf( esc_html__( 'The plugin Yoast SEO has been detected. Do you want to %simport its settings%s into All in One SEO Pack?', 'all-in-one-seo-pack' ), sprintf( '<a href="%s">', esc_url( $aiourl ) ), '</a>' ), '</p></div>';
}
echo '<div class="error"><p>', sprintf( esc_html__( 'The plugin All-In-One-SEO has been detected. Do you want to %simport its settings%s?', 'wordpress-seo' ), sprintf( '<a href="%s">', esc_url( $yoasturl ) ), '</a>' ), '</p></div>';
}
public function show_deactivate_notice() {
echo '<div class="updated"><p>', esc_html__( 'All in One SEO has been deactivated', 'all-in-one-seo-pack' ), '</p></div>';
}
}
} else {
if(is_admin()) {
add_action( 'init', 'mi_aioseop_yst_detected_notice_dismissed' );
}
}
/**
* Deletes the stored dismissal of the notice.
*
* This should only happen after reactivating after being deactivated.
*/
function mi_aioseop_yst_detected_notice_dismissed() {
delete_user_meta( get_current_user_id(), 'aioseop_yst_detected_notice_dismissed' );
}
/**
* Init for settings import class.
*
* At the moment we just register the admin menu page.
*/
function aiosp_seometa_settings_init() {
global $_aiosp_seometa_admin_pagehook;
// TODO Put this in with the rest of the import/export stuff.
$_aiosp_seometa_admin_pagehook = add_submenu_page( 'tools.php', __( 'Import SEO Data', 'all-in-one-seo-pack' ), __( 'SEO Data Import', 'all-in-one-seo-pack' ), 'manage_options', 'aiosp_import', 'aiosp_seometa_admin' );
}
add_action( 'admin_menu', 'aiosp_seometa_settings_init' );
/**
* Intercept POST data from the form submission.
*
* Use the intercepted data to convert values in the postmeta table from one platform to another.
*/
function aiosp_seometa_action() {
if ( empty( $_REQUEST['_wpnonce'] ) ) {
return;
}
if ( empty( $_REQUEST['platform_old'] ) ) {
printf( '<div class="error"><p>%s</p></div>', __( 'Sorry, you can\'t do that. Please choose a platform and then click Analyze or Convert.' ) );
return;
}
if ( 'All in One SEO Pack' === $_REQUEST['platform_old'] ) {
printf( '<div class="error"><p>%s</p></div>', __( 'Sorry, you can\'t do that. Please choose a platform and then click Analyze or Convert.' ) );
return;
}
check_admin_referer( 'aiosp_nonce' ); // Verify nonce. TODO We should make this better.
if ( ! empty( $_REQUEST['analyze'] ) ) {
printf( '<h3>%s</h3>', __( 'Analysis Results', 'all-in-one-seo-pack' ) );
$response = aiosp_seometa_post_meta_analyze( $_REQUEST['platform_old'], 'All in One SEO Pack' );
if ( is_wp_error( $response ) ) {
printf( '<div class="error"><p>%s</p></div>', __( 'Sorry, something went wrong. Please try again' ) );
return;
}
printf( __( '<p>Analyzing records in a %s to %s conversion&hellip;', 'all-in-one-seo-pack' ), esc_html( $_POST['platform_old'] ), 'All in One SEO Pack' );
printf( '<p><b>%d</b> Compatible Records were identified</p>', $response->update );
// printf( '<p>%d Compatible Records will be ignored</p>', $response->ignore );
printf( '<p><b>%s</b></p>', __( 'Compatible data:', 'all-in-one-seo-pack' ) );
echo '<ol>';
foreach ( (array) $response->elements as $element ) {
printf( '<li>%s</li>', $element );
}
echo '</ol>';
return;
}
printf( '<h3>%s</h3>', __( 'Conversion Results', 'all-in-one-seo-pack' ) );
$result = aiosp_seometa_post_meta_convert( stripslashes( $_REQUEST['platform_old'] ), 'All in One SEO Pack' );
if ( is_wp_error( $result ) ) {
printf( '<p>%s</p>', __( 'Sorry, something went wrong. Please try again' ) );
return;
}
printf( '<p><b>%d</b> Records were updated</p>', isset( $result->updated ) ? $result->updated : 0 );
printf( '<p><b>%d</b> Records were ignored</p>', isset( $result->ignored ) ? $result->ignored : 0 );
}
/**
* This function displays feedback to the user about compatible conversion
* elements and the conversion process via the admin_alert hook.
*/
/**
* The admin page output
*/
function aiosp_seometa_admin() {
global $_aiosp_seometa_themes, $_aiosp_seometa_plugins, $_aiosp_seometa_platforms;
?>
<div class="wrap">
<h2><?php _e( 'Import SEO Settings', 'all-in-one-seo-pack' ); ?></h2>
<p><span
class="description"><?php printf( __( 'Use the drop down below to choose which plugin or theme you wish to import SEO data from.', 'all-in-one-seo-pack' ) ); ?></span>
</p>
<p><span
class="description"><?php printf( __( 'Click "Analyze" for a list of SEO data that can be imported into All in One SEO Pack, along with the number of records that will be imported.', 'all-in-one-seo-pack' ) ); ?></span>
</p>
<p><span
class="description"><strong><?php printf( __( 'Please Note: ' ) ); ?></strong><?php printf( __( 'Some plugins and themes do not share similar data, or they store data in a non-standard way. If we cannot import this data, it will remain unchanged in your database. Any compatible SEO data will be displayed for you to review. If a post or page already has SEO data in All in One SEO Pack, we will not import data from another plugin/theme.', 'all-in-one-seo-pack' ) ); ?></span>
</p>
<p><span
class="description"><?php printf( __( 'Click "Convert" to perform the import. After the import has completed, you will be alerted to how many records were imported, and how many records had to be ignored, based on the criteria above.', 'all-in-one-seo-pack' ) ); ?></span>
</p>
<p><span
class="row-title"><?php printf( esc_html__( 'Before performing an import, we strongly recommend that you make a backup of your site. We use and recommend %s BackupBuddy %s for backups.', 'all-in-one-seo-pack' ), sprintf( '<a target="_blank" href="%s">', esc_url( 'https://semperfiwebdesign.com/backupbuddy/' ) ), '</a>' ); ?></span>
</p>
<form action="<?php echo admin_url( 'tools.php?page=aiosp_import' ); ?>" method="post">
<?php
wp_nonce_field( 'aiosp_nonce' );
$platform_old = ( ! isset( $_POST['platform_old'] ) ) ? '' : $_POST['platform_old'];
_e( 'Import SEO data from:', 'all-in-one-seo-pack' );
echo '<select name="platform_old">';
printf( '<option value="">%s</option>', __( 'Choose platform:', 'all-in-one-seo-pack' ) );
printf( '<optgroup label="%s">', __( 'Plugins', 'all-in-one-seo-pack' ) );
foreach ( $_aiosp_seometa_plugins as $platform => $data ) {
if ( 'All in One SEO Pack' !== $platform ) {
printf( '<option value="%s" %s>%s</option>', $platform, selected( $platform, $platform_old, 0 ), $platform );
}
}
printf( '</optgroup>' );
printf( '<optgroup label="%s">', __( 'Themes', 'all-in-one-seo-pack' ) );
foreach ( $_aiosp_seometa_themes as $platform => $data ) {
printf( '<option value="%s" %s>%s</option>', $platform, selected( $platform, $platform_old, 0 ), $platform );
}
printf( '</optgroup>' );
echo '</select>' . "\n\n";
?>
<input type="submit" class="button-highlighted" name="analyze"
value="<?php _e( 'Analyze', 'genesis' ); ?>"/>
<input type="submit" class="button-primary" value="<?php _e( 'Convert', 'genesis' ) ?>"/>
</form>
<?php aiosp_seometa_action(); ?>
</div>
<?php
}
/**
* Convert old meta_key entries in the post meta table into new entries.
*
* First check to see what records for $new already exist, storing the corresponding post_id values in an array.
* When the conversion happens, ignore rows that contain a post_id, to avoid duplicate entries.
*
*
* @param string $old Old meta_key entries.
* @param string $new New meta_key entries.
* @param bool $delete_old Whether to delete the old entries.
*
* @return stdClass Object for error detection, and the number of affected rows.
*/
function aiosp_seometa_meta_key_convert( $old = '', $new = '', $delete_old = false ) {
do_action( 'pre_aiosp_seometa_meta_key_convert_before', $old, $new, $delete_old );
global $wpdb;
$output = new stdClass;
if ( ! $old || ! $new ) {
$output->WP_Error = 1;
return $output;
}
// See which records we need to ignore, if any.
$exclude = $wpdb->get_results( $wpdb->prepare( "SELECT post_id FROM $wpdb->postmeta WHERE meta_key = %s", $new ) );
// If no records to ignore, we'll do a basic UPDATE and DELETE.
if ( ! $exclude ) {
$output->updated = $wpdb->update( $wpdb->postmeta, array( 'meta_key' => $new ), array( 'meta_key' => $old ) );
$output->deleted = $delete_old ? $wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->postmeta WHERE meta_key = %s", $old ) ) : 0;
$output->ignored = 0;
} // Else, do a more complex UPDATE and DELETE.
else {
foreach ( (array) $exclude as $key => $value ) {
$not_in[] = $value->post_id;
}
$not_in = implode( ', ', (array) $not_in );
$output->updated = $wpdb->query( $wpdb->prepare( "UPDATE $wpdb->postmeta SET meta_key = %s WHERE meta_key = %s AND post_id NOT IN ($not_in)", $new, $old ) );
$output->deleted = $delete_old ? $wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->postmeta WHERE meta_key = %s", $old ) ) : 0;
$output->ignored = count( $exclude );
}
do_action( 'aiosp_seometa_meta_key_convert', $output, $old, $new, $delete_old );
return $output;
}
/**
* Convert old to new postmeta.
*
* Cycle through all compatible SEO entries of two platforms and aiosp_seometa_meta_key_convert conversion for each key.
*
* @param string $old_platform
* @param string $new_platform
* @param bool $delete_old
*
* @return stdClass Results object.
*/
function aiosp_seometa_post_meta_convert( $old_platform = '', $new_platform = 'All in One SEO Pack', $delete_old = false ) {
do_action( 'pre_aiosp_seometa_post_meta_convert', $old_platform, $new_platform, $delete_old );
global $_aiosp_seometa_platforms;
$output = new stdClass;
if ( empty( $_aiosp_seometa_platforms[ $old_platform ] ) || empty( $_aiosp_seometa_platforms[ $new_platform ] ) ) {
$output->WP_Error = 1;
return $output;
}
$output->updated = 0;
$output->deleted = 0;
$output->ignored = 0;
foreach ( (array) $_aiosp_seometa_platforms[ $old_platform ] as $label => $meta_key ) {
// Skip iterations where no $new analog exists.
if ( empty( $_aiosp_seometa_platforms[ $new_platform ][ $label ] ) ) {
continue;
}
// Set $old and $new meta_key values.
$old = $_aiosp_seometa_platforms[ $old_platform ][ $label ];
$new = $_aiosp_seometa_platforms[ $new_platform ][ $label ];
// Convert.
$result = aiosp_seometa_meta_key_convert( $old, $new, $delete_old );
// Error check.
if ( is_wp_error( $result ) ) {
continue;
}
// Update total updated/ignored count.
$output->updated += (int) $result->updated;
$output->ignored += (int) $result->ignored;
}
do_action( 'aiosp_seometa_post_meta_convert', $output, $old_platform, $new_platform, $delete_old );
return $output;
}
/**
* Analyze two platforms to find shared and compatible elements.
*
* See what data can be converted from one to the other.
*
* @param string $old_platform
* @param string $new_platform
*
* @return stdClass
*/
function aiosp_seometa_post_meta_analyze( $old_platform = '', $new_platform = 'All in One SEO Pack' ) {
// TODO Figure out which elements to ignore.
do_action( 'pre_aiosp_seometa_post_meta_analyze', $old_platform, $new_platform );
global $wpdb, $_aiosp_seometa_platforms;
$output = new stdClass;
if ( empty( $_aiosp_seometa_platforms[ $old_platform ] ) || empty( $_aiosp_seometa_platforms[ $new_platform ] ) ) {
$output->WP_Error = 1;
return $output;
}
$output->update = 0;
$output->ignore = 0;
$output->elements = '';
foreach ( (array) $_aiosp_seometa_platforms[ $old_platform ] as $label => $meta_key ) {
// Skip iterations where no $new analog exists.
if ( empty( $_aiosp_seometa_platforms[ $new_platform ][ $label ] ) ) {
continue;
}
$elements[] = $label;
// See which records to ignore, if any.
$ignore = 0;
// $ignore = $wpdb->get_results( $wpdb->prepare( "SELECT post_id FROM $wpdb->postmeta WHERE meta_key = %s", $meta_key ) );
// See which records to update, if any.
$update = $wpdb->get_results( $wpdb->prepare( "SELECT post_id FROM $wpdb->postmeta WHERE meta_key = %s", $meta_key ) );
// Count items in returned arrays.
// $ignore = count( (array)$ignore );
$update = count( (array) $update );
// Calculate update/ignore by comparison.
// $update = ( (int)$update > (int)$ignore ) ? ( (int)$update - (int)$ignore ) : 0;
// update output numbers
$output->update += (int) $update;
$output->ignore += (int) $ignore;
}
$output->elements = $elements;
do_action( 'aiosp_seometa_post_meta_analyze', $output, $old_platform, $new_platform );
return $output;
}
// define('aiosp_seometa_PLUGIN_DIR', dirname(__FILE__));
//add_action( 'plugins_loaded', 'aiosp_seometa_import' );
/**
* Initialize the SEO Data Transporter plugin
*/
function aiosp_seometa_import() {
global $_aiosp_seometa_themes, $_aiosp_seometa_plugins, $_aiosp_seometa_platforms;
/**
* The associative array of supported themes.
*/
$_aiosp_seometa_themes = array(
// alphabatized
'Builder' => array(
'Custom Doctitle' => '_builder_seo_title',
'META Description' => '_builder_seo_description',
'META Keywords' => '_builder_seo_keywords',
),
'Catalyst' => array(
'Custom Doctitle' => '_catalyst_title',
'META Description' => '_catalyst_description',
'META Keywords' => '_catalyst_keywords',
'noindex' => '_catalyst_noindex',
'nofollow' => '_catalyst_nofollow',
'noarchive' => '_catalyst_noarchive',
),
'Frugal' => array(
'Custom Doctitle' => '_title',
'META Description' => '_description',
'META Keywords' => '_keywords',
'noindex' => '_noindex',
'nofollow' => '_nofollow',
),
'Genesis' => array(
'Custom Doctitle' => '_genesis_title',
'META Description' => '_genesis_description',
'META Keywords' => '_genesis_keywords',
'noindex' => '_genesis_noindex',
'nofollow' => '_genesis_nofollow',
'noarchive' => '_genesis_noarchive',
'Canonical URI' => '_genesis_canonical_uri',
'Custom Scripts' => '_genesis_scripts',
'Redirect URI' => 'redirect',
),
'Headway' => array(
'Custom Doctitle' => '_title',
'META Description' => '_description',
'META Keywords' => '_keywords',
),
'Hybrid' => array(
'Custom Doctitle' => 'Title',
'META Description' => 'Description',
'META Keywords' => 'Keywords',
),
'Thesis 1.x' => array(
'Custom Doctitle' => 'thesis_title',
'META Description' => 'thesis_description',
'META Keywords' => 'thesis_keywords',
'Custom Scripts' => 'thesis_javascript_scripts',
'Redirect URI' => 'thesis_redirect',
),
/*
'Thesis 2.x' => array(
'Custom Doctitle' => '_thesis_title_tag',
'META Description' => '_thesis_meta_description',
'META Keywords' => '_thesis_meta_keywords',
'Custom Scripts' => '_thesis_javascript_scripts',
'Canonical URI' => '_thesis_canonical_link',
'Redirect URI' => '_thesis_redirect',
),
*/
'WooFramework' => array(
'Custom Doctitle' => 'seo_title',
'META Description' => 'seo_description',
'META Keywords' => 'seo_keywords',
),
);
/**
* The associative array of supported plugins.
*/
$_aiosp_seometa_plugins = array(
// alphabatized
'Add Meta Tags' => array(
'Custom Doctitle' => '_amt_title',
'META Description' => '_amt_description',
'META Keywords' => '_amt_keywords',
),
'All in One SEO Pack' => array(
'Custom Doctitle' => '_aioseop_title',
'META Description' => '_aioseop_description',
'META Keywords' => '_aioseop_keywords',
),
'Greg\'s High Performance SEO' => array(
'Custom Doctitle' => '_ghpseo_secondary_title',
'META Description' => '_ghpseo_alternative_description',
'META Keywords' => '_ghpseo_keywords',
),
'Headspace2' => array(
'Custom Doctitle' => '_headspace_page_title',
'META Description' => '_headspace_description',
'META Keywords' => '_headspace_keywords',
'Custom Scripts' => '_headspace_scripts',
),
'Infinite SEO' => array(
'Custom Doctitle' => '_wds_title',
'META Description' => '_wds_metadesc',
'META Keywords' => '_wds_keywords',
'noindex' => '_wds_meta-robots-noindex',
'nofollow' => '_wds_meta-robots-nofollow',
'Canonical URI' => '_wds_canonical',
'Redirect URI' => '_wds_redirect',
),
'Meta SEO Pack' => array(
'META Description' => '_msp_description',
'META Keywords' => '_msp_keywords',
),
'Platinum SEO' => array(
'Custom Doctitle' => 'title',
'META Description' => 'description',
'META Keywords' => 'keywords',
),
'SEO Title Tag' => array(
'Custom Doctitle' => 'title_tag',
'META Description' => 'meta_description',
),
'SEO Ultimate' => array(
'Custom Doctitle' => '_su_title',
'META Description' => '_su_description',
'META Keywords' => '_su_keywords',
'noindex' => '_su_meta_robots_noindex',
'nofollow' => '_su_meta_robots_nofollow',
),
'Yoast SEO' => array(
'Custom Doctitle' => '_yoast_wpseo_title',
'META Description' => '_yoast_wpseo_metadesc',
'META Keywords' => '_yoast_wpseo_metakeywords',
'noindex' => '_yoast_wpseo_meta-robots-noindex',
'nofollow' => '_yoast_wpseo_meta-robots-nofollow',
'Canonical URI' => '_yoast_wpseo_canonical',
'Redirect URI' => '_yoast_wpseo_redirect',
),
);
/**
* The combined array of supported platforms.
*/
$_aiosp_seometa_platforms = array_merge( $_aiosp_seometa_themes, $_aiosp_seometa_plugins );
/**
* Include the other elements of the plugin.
*/
// require_once( aiosp_seometa_PLUGIN_DIR . '/admin.php' );
// require_once( aiosp_seometa_PLUGIN_DIR . '/functions.php' );
/**
* Init hook.
*
* Hook fires after plugin functions are loaded.
*
* @since 0.9.10
*
*/
do_action( 'aiosp_seometa_import' );
}
/**
* Activation Hook
* @since 0.9.4
*/
register_activation_hook( __FILE__, 'aiosp_seometa_activation_hook' );
function aiosp_seometa_activation_hook() {
// require_once( aiosp_seometa_PLUGIN_DIR . '/functions.php' );
aiosp_seometa_meta_key_convert( '_yoast_seo_title', 'yoast_wpseo_title', true );
aiosp_seometa_meta_key_convert( '_yoast_seo_metadesc', 'yoast_wpseo_metadesc', true );
}
/**
* Manual conversion test
*/
/*
$aiosp_seometa_convert = aiosp_seometa_post_meta_convert( 'All in One SEO Pack', 'Genesis', false );
printf( '%d records were updated', $aiosp_seometa_convert->updated );
/**/
/**
* Manual analysis test
*/
/*
$aiosp_seometa_analyze = aiosp_seometa_post_meta_analyze( 'All in One SEO Pack', 'Genesis' );
printf( '<p><b>%d</b> Compatible Records were identified</p>', $aiosp_seometa_analyze->update );
/**/
/**
* Delete all SEO data, from every platform
*/
/*
foreach ( $_aiosp_seometa_platforms as $platform => $data ) {
foreach ( $data as $field ) {
$deleted = $wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->postmeta WHERE meta_key = %s", $field ) );
printf( '%d %s records deleted<br />', $deleted, $field );
}
}
/**/
/**
* Query all SEO data to find the number of records to change
*/

@ -0,0 +1,7 @@
<?php
/**
* We'll eventually put stuff in here from the main plugin file.
*
* @package All-in-One-SEO-Pack
*
*/

File diff suppressed because it is too large Load Diff

@ -0,0 +1,491 @@
<?php
/*
Plugin Name: All In One SEO Pack
Plugin URI: https://semperfiwebdesign.com
Description: Out-of-the-box SEO for your WordPress blog. Features like XML Sitemaps, SEO for custom post types, SEO for blogs or business sites, SEO for ecommerce sites, and much more. Almost 30 million downloads since 2007.
Version: 2.3.11
Author: Michael Torbert
Author URI: https://michaeltorbert.com
Text Domain: all-in-one-seo-pack
Domain Path: /i18n/
*/
/*
Copyright (C) 2007-2016 Michael Torbert, https://semperfiwebdesign.com
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; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* All in One SEO Pack.
* The original WordPress SEO plugin.
*
* @package All-in-One-SEO-Pack
* @version 2.3.11
*/
if ( ! defined( 'AIOSEOPPRO' ) ) {
define( 'AIOSEOPPRO', false );
}
if ( ! defined( 'AIOSEOP_VERSION' ) ) {
define( 'AIOSEOP_VERSION', '2.3.11' );
}
global $aioseop_plugin_name;
$aioseop_plugin_name = 'All in One SEO Pack';
/*
* DO NOT EDIT BELOW THIS LINE.
*/
if ( ! defined( 'ABSPATH' ) ) {
return;
}
if ( AIOSEOPPRO ) {
add_action( 'admin_head', 'disable_all_in_one_free', 1 );
}
if ( ! function_exists( 'aiosp_add_cap' ) ) {
function aiosp_add_cap() {
/*
TODO we should put this into an install script. We just need to make sure it runs soon enough and we need to make
sure people updating from previous versions have access to it.
*/
$role = get_role( 'administrator' );
if ( is_object( $role ) ) {
$role->add_cap( 'aiosp_manage_seo' );
}
}
}
add_action( 'plugins_loaded', 'aiosp_add_cap' );
if ( ! defined( 'AIOSEOP_PLUGIN_NAME' ) ) {
define( 'AIOSEOP_PLUGIN_NAME', $aioseop_plugin_name );
}
if ( ! defined( 'AIOSEOP_PLUGIN_DIR' ) ) {
define( 'AIOSEOP_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
} elseif ( AIOSEOP_PLUGIN_DIR !== plugin_dir_path( __FILE__ ) ) {
/*
This is not a great message.
add_action( 'admin_notices', create_function( '', 'echo "' . "<div class='error'>" . sprintf(
__( "%s detected a conflict; please deactivate the plugin located in %s.", 'all-in-one-seo-pack' ),
$aioseop_plugin_name, AIOSEOP_PLUGIN_DIR ) . "</div>" . '";' ) );
*/
return;
}
if ( ! defined( 'AIOSEOP_PLUGIN_BASENAME' ) ) {
define( 'AIOSEOP_PLUGIN_BASENAME', plugin_basename( __FILE__ ) );
}
if ( ! defined( 'AIOSEOP_PLUGIN_DIRNAME' ) ) {
define( 'AIOSEOP_PLUGIN_DIRNAME', dirname( AIOSEOP_PLUGIN_BASENAME ) );
}
if ( ! defined( 'AIOSEOP_PLUGIN_URL' ) ) {
define( 'AIOSEOP_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
}
if ( ! defined( 'AIOSEOP_PLUGIN_IMAGES_URL' ) ) {
define( 'AIOSEOP_PLUGIN_IMAGES_URL', AIOSEOP_PLUGIN_URL . 'images/' );
}
if ( ! defined( 'AIOSEOP_BASELINE_MEM_LIMIT' ) ) {
define( 'AIOSEOP_BASELINE_MEM_LIMIT', 268435456 );
} // 256MB
if ( ! defined( 'WP_CONTENT_URL' ) ) {
define( 'WP_CONTENT_URL', site_url() . '/wp-content' );
}
if ( ! defined( 'WP_ADMIN_URL' ) ) {
define( 'WP_ADMIN_URL', site_url() . '/wp-admin' );
}
if ( ! defined( 'WP_CONTENT_DIR' ) ) {
define( 'WP_CONTENT_DIR', ABSPATH . 'wp-content' );
}
if ( ! defined( 'WP_PLUGIN_URL' ) ) {
define( 'WP_PLUGIN_URL', WP_CONTENT_URL . '/plugins' );
}
if ( ! defined( 'WP_PLUGIN_DIR' ) ) {
define( 'WP_PLUGIN_DIR', WP_CONTENT_DIR . '/plugins' );
}
global $aiosp, $aioseop_options, $aioseop_modules, $aioseop_module_list, $aiosp_activation, $aioseop_mem_limit, $aioseop_get_pages_start, $aioseop_admin_menu;
$aioseop_get_pages_start = $aioseop_admin_menu = 0;
if ( AIOSEOPPRO ) {
global $aioseop_update_checker;
}
$aioseop_options = get_option( 'aioseop_options' );
$aioseop_mem_limit = @ini_get( 'memory_limit' );
if ( ! function_exists( 'aioseop_convert_bytestring' ) ) {
/**
* @param $byte_string
*
* @return int
*/
function aioseop_convert_bytestring( $byte_string ) {
$num = 0;
preg_match( '/^\s*([0-9.]+)\s*([KMGTPE])B?\s*$/i', $byte_string, $matches );
if ( ! empty( $matches ) ) {
$num = (float) $matches[1];
switch ( strtoupper( $matches[2] ) ) {
case 'E':
$num *= 1024;
case 'P':
$num *= 1024;
case 'T':
$num *= 1024;
case 'G':
$num *= 1024;
case 'M':
$num *= 1024;
case 'K':
$num *= 1024;
}
}
return intval( $num );
}
}
if ( is_array( $aioseop_options ) && isset( $aioseop_options['modules'] ) && isset( $aioseop_options['modules']['aiosp_performance_options'] ) ) {
$perf_opts = $aioseop_options['modules']['aiosp_performance_options'];
if ( isset( $perf_opts['aiosp_performance_memory_limit'] ) ) {
$aioseop_mem_limit = $perf_opts['aiosp_performance_memory_limit'];
}
if ( isset( $perf_opts['aiosp_performance_execution_time'] ) && ( '' !== $perf_opts['aiosp_performance_execution_time'] ) ) {
@ini_set( 'max_execution_time', (int) $perf_opts['aiosp_performance_execution_time'] );
@set_time_limit( (int) $perf_opts['aiosp_performance_execution_time'] );
}
} else {
$aioseop_mem_limit = aioseop_convert_bytestring( $aioseop_mem_limit );
if ( ( $aioseop_mem_limit > 0 ) && ( $aioseop_mem_limit < AIOSEOP_BASELINE_MEM_LIMIT ) ) {
$aioseop_mem_limit = AIOSEOP_BASELINE_MEM_LIMIT;
}
}
if ( ! empty( $aioseop_mem_limit ) ) {
if ( ! is_int( $aioseop_mem_limit ) ) {
$aioseop_mem_limit = aioseop_convert_bytestring( $aioseop_mem_limit );
}
if ( ( $aioseop_mem_limit > 0 ) && ( $aioseop_mem_limit <= AIOSEOP_BASELINE_MEM_LIMIT ) ) {
@ini_set( 'memory_limit', $aioseop_mem_limit );
}
}
$aiosp_activation = false;
$aioseop_module_list = array(
'sitemap',
'opengraph',
'robots',
'file_editor',
'importer_exporter',
'bad_robots',
'performance',
); // list all available modules here
if ( AIOSEOPPRO ) {
$aioseop_module_list[] = 'video_sitemap';
}
if ( class_exists( 'All_in_One_SEO_Pack' ) ) {
add_action( 'admin_notices', create_function( '', 'echo "<div class=\'error\'>The All In One SEO Pack class is already defined";'
. "if ( class_exists( 'ReflectionClass' ) ) { \$r = new ReflectionClass( 'All_in_One_SEO_Pack' ); echo ' in ' . \$r->getFileName(); } "
. ' echo ", preventing All In One SEO Pack from loading.</div>";' ) );
return;
}
if ( AIOSEOPPRO ) {
require( AIOSEOP_PLUGIN_DIR . 'pro/sfwd_update_checker.php' );
$aiosp_update_url = 'https://semperplugins.com/upgrade_plugins.php';
if( defined( 'AIOSEOP_UPDATE_URL' ) ) {
$aiosp_update_url = AIOSEOP_UPDATE_URL;
}
$aioseop_update_checker = new SFWD_Update_Checker(
$aiosp_update_url,
__FILE__,
'aioseop'
);
$aioseop_update_checker->plugin_name = AIOSEOP_PLUGIN_NAME;
$aioseop_update_checker->plugin_basename = AIOSEOP_PLUGIN_BASENAME;
if ( ! empty( $aioseop_options['aiosp_license_key'] ) ) {
$aioseop_update_checker->license_key = $aioseop_options['aiosp_license_key'];
} else {
$aioseop_update_checker->license_key = '';
}
$aioseop_update_checker->options_page = AIOSEOP_PLUGIN_DIRNAME . "/aioseop_class.php";
$aioseop_update_checker->renewal_page = 'https://semperplugins.com/all-in-one-seo-pack-pro-support-updates-renewal/';
$aioseop_update_checker->addQueryArgFilter( array( $aioseop_update_checker, 'add_secret_key' ) );
}
if ( ! function_exists( 'aioseop_activate' ) ) {
function aioseop_activate() {
//Check if we just got activated.
global $aiosp_activation;
if ( AIOSEOPPRO ) {
global $aioseop_update_checker;
}
$aiosp_activation = true;
// These checks might be duplicated in the function being called.
if( ! is_network_admin() || !isset( $_GET['activate-multi'] ) ) {
set_transient( '_aioseop_activation_redirect', true, 30 ); // Sets 30 second transient for welcome screen redirect on activation.
}
delete_user_meta( get_current_user_id(), 'aioseop_yst_detected_notice_dismissed' );
if ( AIOSEOPPRO ) {
$aioseop_update_checker->checkForUpdates();
}
}
}
add_action( 'plugins_loaded', 'aioseop_init_class' );
if ( ! function_exists( 'aiosp_plugin_row_meta' ) ) {
add_filter( 'plugin_row_meta', 'aiosp_plugin_row_meta', 10, 2 );
/**
* @param $actions
* @param $plugin_file
*
* @return array
*/
function aiosp_plugin_row_meta( $actions, $plugin_file ) {
if ( ! AIOSEOPPRO ) {
$action_links = array(
);
} else {
$action_links = '';
}
return aiosp_action_links( $actions, $plugin_file, $action_links, 'after' );
}
}
if ( ! function_exists( 'aiosp_add_action_links' ) ) {
add_filter( 'plugin_action_links_' . plugin_basename( __FILE__ ), 'aiosp_add_action_links', 10, 2 );
/**
* @param $actions
* @param $plugin_file
*
* @return array
*/
function aiosp_add_action_links( $actions, $plugin_file ) {
$aioseop_plugin_dirname = AIOSEOP_PLUGIN_DIRNAME;
$action_links = array();
$action_links = array(
'settings' => array(
'label' => __( 'SEO Settings', 'all-in-one-seo-pack' ),
'url' => get_admin_url( null, "admin.php?page=$aioseop_plugin_dirname/aioseop_class.php" ),
),
'forum' => array(
'label' => __( 'Support Forum', 'all-in-one-seo-pack' ),
'url' => 'https://semperplugins.com/support/',
),
'docs' => array(
'label' => __( 'Documentation', 'all-in-one-seo-pack' ),
'url' => 'https://semperplugins.com/documentation/',
),
);
unset( $actions['edit'] );
if ( ! AIOSEOPPRO ) {
$action_links['proupgrade'] =
array(
'label' => __( 'Upgrade to Pro', 'all-in-one-seo-pack' ),
'url' => 'https://semperplugins.com/plugins/all-in-one-seo-pack-pro-version/?loc=plugins',
);
}
return aiosp_action_links( $actions, $plugin_file, $action_links, 'before' );
}
}
if ( ! function_exists( 'aiosp_action_links' ) ) {
/**
* @param $actions
* @param $plugin_file
* @param array $action_links
* @param string $position
*
* @return array
*/
function aiosp_action_links( $actions, $plugin_file, $action_links = array(), $position = 'after' ) {
static $plugin;
if ( ! isset( $plugin ) ) {
$plugin = plugin_basename( __FILE__ );
}
if ( $plugin === $plugin_file && ! empty( $action_links ) ) {
foreach ( $action_links as $key => $value ) {
$link = array( $key => '<a href="' . $value['url'] . '">' . $value['label'] . '</a>' );
if ( 'after' === $position ) {
$actions = array_merge( $actions, $link );
} else {
$actions = array_merge( $link, $actions );
}
}//foreach
}// if
return $actions;
}
}
if ( ! function_exists( 'aioseop_init_class' ) ) {
function aioseop_init_class() {
global $aiosp;
load_plugin_textdomain( 'all-in-one-seo-pack', false, dirname( plugin_basename( __FILE__ ) ) . '/i18n/' );
require_once( AIOSEOP_PLUGIN_DIR . 'inc/aioseop_functions.php' );
require_once( AIOSEOP_PLUGIN_DIR . 'aioseop_class.php' );
require_once( AIOSEOP_PLUGIN_DIR . 'inc/aioseop_updates_class.php' );
require_once( AIOSEOP_PLUGIN_DIR . 'inc/commonstrings.php' );
require_once( AIOSEOP_PLUGIN_DIR . 'admin/display/postedit.php' );
require_once( AIOSEOP_PLUGIN_DIR . 'admin/display/general-metaboxes.php' );
require_once( AIOSEOP_PLUGIN_DIR . 'inc/aiosp_common.php' );
require_once( AIOSEOP_PLUGIN_DIR . 'admin/meta_import.php' );
require_once( AIOSEOP_PLUGIN_DIR . 'inc/translations.php' );
require_once( AIOSEOP_PLUGIN_DIR . 'public/opengraph.php' );
require_once( AIOSEOP_PLUGIN_DIR . 'inc/compatability/compat-init.php');
require_once( AIOSEOP_PLUGIN_DIR . 'public/front.php' );
require_once( AIOSEOP_PLUGIN_DIR . 'public/google-analytics.php' );
require_once( AIOSEOP_PLUGIN_DIR . 'admin/display/welcome.php' );
require_once( AIOSEOP_PLUGIN_DIR . 'admin/display/dashboard_widget.php' );
$aioseop_welcome = new aioseop_welcome(); // TODO move this to updates file.
if ( AIOSEOPPRO ) {
require_once( AIOSEOP_PLUGIN_DIR . 'pro/class-aio-pro-init.php' ); // Loads pro files and other pro init stuff.
}
aiosp_seometa_import(); // call importer functions... this should be moved somewhere better
$aiosp = new All_in_One_SEO_Pack();
$aioseop_updates = new AIOSEOP_Updates();
if ( AIOSEOPPRO ) {
$aioseop_pro_updates = new AIOSEOP_Pro_Updates();
add_action( 'admin_init', array( $aioseop_pro_updates, 'version_updates' ), 12 );
}
add_action( 'admin_init', 'aioseop_welcome' );
if ( aioseop_option_isset( 'aiosp_unprotect_meta' ) ) {
add_filter( 'is_protected_meta', 'aioseop_unprotect_meta', 10, 3 );
}
add_action( 'init', array( $aiosp, 'add_hooks' ) );
add_action( 'admin_init', array( $aioseop_updates, 'version_updates' ), 11 );
if ( defined( 'DOING_AJAX' ) && ! empty( $_POST ) && ! empty( $_POST['action'] ) && 'aioseop_ajax_scan_header' === $_POST['action'] ) {
remove_action( 'init', array( $aiosp, 'add_hooks' ) );
add_action( 'admin_init', 'aioseop_scan_post_header' );
add_action( 'shutdown', 'aioseop_ajax_scan_header' ); // if the action doesn't run -- pdb
include_once( ABSPATH . 'wp-admin/includes/screen.php' );
global $current_screen;
if ( class_exists( 'WP_Screen' ) ) {
$current_screen = WP_Screen::get( 'front' );
}
}
}
}
if ( ! function_exists( 'aioseop_welcome' ) ){
function aioseop_welcome(){
if( get_transient( '_aioseop_activation_redirect') ){
$aioseop_welcome = new aioseop_welcome();
delete_transient( '_aioseop_activation_redirect' );
$aioseop_welcome->init( TRUE );
}
}
}
add_action( 'init', 'aioseop_load_modules', 1 );
//add_action( 'after_setup_theme', 'aioseop_load_modules' );
if ( is_admin() ) {
add_action( 'wp_ajax_aioseop_ajax_save_meta', 'aioseop_ajax_save_meta' );
add_action( 'wp_ajax_aioseop_ajax_save_url', 'aioseop_ajax_save_url' );
add_action( 'wp_ajax_aioseop_ajax_delete_url', 'aioseop_ajax_delete_url' );
add_action( 'wp_ajax_aioseop_ajax_scan_header', 'aioseop_ajax_scan_header' );
if ( AIOSEOPPRO ) {
add_action( 'wp_ajax_aioseop_ajax_facebook_debug', 'aioseop_ajax_facebook_debug' );
}
add_action( 'wp_ajax_aioseop_ajax_save_settings', 'aioseop_ajax_save_settings' );
add_action( 'wp_ajax_aioseop_ajax_get_menu_links', 'aioseop_ajax_get_menu_links' );
add_action( 'wp_ajax_aioseo_dismiss_yst_notice', 'aioseop_update_yst_detected_notice' );
add_action( 'wp_ajax_aioseo_dismiss_visibility_notice', 'aioseop_update_user_visibilitynotice' );
add_action( 'wp_ajax_aioseo_dismiss_woo_upgrade_notice', 'aioseop_woo_upgrade_notice_dismissed' );
if ( AIOSEOPPRO ) {
add_action( 'wp_ajax_aioseop_ajax_update_oembed', 'aioseop_ajax_update_oembed' );
}
}
if ( ! function_exists( 'aioseop_scan_post_header' ) ) {
function aioseop_scan_post_header() {
require_once( ABSPATH . WPINC . '/default-filters.php' );
global $wp_query;
$wp_query->query_vars['paged'] = 0;
query_posts( 'post_type=post&posts_per_page=1' );
if ( have_posts() ) {
the_post();
}
}
}
require_once( AIOSEOP_PLUGIN_DIR . 'aioseop-init.php' );
if ( ! function_exists( 'aioseop_install' ) ) {
register_activation_hook( __FILE__, 'aioseop_install' );
function aioseop_install() {
aioseop_activate();
}
}
if ( ! function_exists( 'disable_all_in_one_free' ) ) {
function disable_all_in_one_free() {
if ( AIOSEOPPRO && is_plugin_active( 'all-in-one-seo-pack/all_in_one_seo_pack.php' ) ) {
deactivate_plugins( 'all-in-one-seo-pack/all_in_one_seo_pack.php' );
}
}
}

@ -0,0 +1,129 @@
#toplevel_page_all-in-one-seo-pack-pro-aioseop_class .wp-menu-image {
background: url(../images/shield-sprite-16.png) no-repeat 8px 6px !important;
}
#toplevel_page_all-in-one-seo-pack-aioseop_class .wp-menu-image {
background: url(../images/shield-sprite-16.png) no-repeat 8px 6px !important;
}
#toplevel_page_all-in-one-seo-pack-pro-aioseop_class .wp-menu-image img {
display: none;
}
#toplevel_page_all-in-one-seo-pack-aioseop_class .wp-menu-image img {
display: none;
}
#adminmenu #toplevel_page_all-in-one-seo-pack-pro-aioseop_class .wp-menu-image:before {
content: '';
}
#toplevel_page_all-in-one-seo-pack-aioseop_class .wp-menu-image:before {
content: '' !important;
}
#toplevel_page_all-in-one-seo-pack-pro-aioseop_class:hover .wp-menu-image, #toplevel_page_all-in-one-seo-pack-pro-aioseop_class.wp-has-current-submenu .wp-menu-image {
background-position: 8px -26px !important;
}
#toplevel_page_all-in-one-seo-pack-aioseop_class:hover .wp-menu-image, #toplevel_page_all-in-one-seo-pack-aioseop_class.wp-has-current-submenu .wp-menu-image {
background-position: 8px -26px !important;
}
#icon-aioseop.icon32 {
background: url(../images/shield32.png) no-repeat left top !important;
}
#aioseop_settings_header #message {
padding: 5px 0px 5px 50px;
background-image: url(../images/update32.png);
background-repeat: no-repeat;
background-position: 10px;
font-size: 14px;
min-height: 32px;
clear: none;
}
@media only screen and (-webkit-min-device-pixel-ratio: 1.5), only screen and ( min--moz-device-pixel-ratio: 1.5), only screen and ( -o-min-device-pixel-ratio: 3/2), only screen and ( min-device-pixel-ratio: 1.5), only screen and ( min-resolution: 1.5dppx) {
#toplevel_page_all-in-one-seo-pack-pro-aioseop_class .wp-menu-image {
background-image: url('../images/shield-sprite-32.png') !important;
-webkit-background-size: 16px 48px !important;
-moz-background-size: 16px 48px !important;
background-size: 16px 48px !important;
}
#toplevel_page_all-in-one-seo-pack-aioseop_class .wp-menu-image {
background-image: url('../images/shield-sprite-32.png') !important;
-webkit-background-size: 16px 48px !important;
-moz-background-size: 16px 48px !important;
background-size: 16px 48px !important;
}
#icon-aioseop.icon32 {
background-image: url('../images/shield64.png') !important;
-webkit-background-size: 32px 32px !important;
-moz-background-size: 32px 32px !important;
background-size: 32px 32px !important;
}
#aioseop_settings_header #message {
background-image: url(../images/update64.png) !important;
-webkit-background-size: 32px 32px !important;
-moz-background-size: 32px 32px !important;
background-size: 32px 32px !important;
}
}
.proupgrade a {
font-weight: 900;
color: #d54e21;
font-size: 105%;
}
li#wp-admin-bar-aioseop-pro-upgrade a.ab-item {
font-weight: 900;
color: #d54e21 !important;
font-size: 110%;
}
#aio-pro-update{
font-weight: 900;
color: #d54e21 !important;
font-size: 110%;
}
/* Dashicons in sidebar */
.aiosp-di .dashicons {
margin:1px;
line-height: 1;
width: 42px;
height:36px;
color:#fff;
padding:3px;
vertical-align:middle;
}
.aiosp-di .dashicons:before {
-webkit-font-smoothing:antialiased;
font:400 30px/1 dashicons;
line-height: 38px;
}
.aiosp-di .dashicons.di-facebook {
margin:0;
}
.aiosp-di .dashicons.di-facebook:before {
content:"\f304";
font-size:52px;
}
.aiosp-di .dashicons.di-twitter:before {
content:"\f301"
}
.aiosp-di .dashicons.di-facebook {
color: #3B5998;
}
.aiosp-di .dashicons.di-twitter {
width: 36px;
background-color:#00aced;
border-radius:2px;
}

@ -0,0 +1,319 @@
* {
direction: rtl !important
}
.form-table.aioseop {
clear: none
}
.form-table.aioseop th {
padding: 10px 9px 12px 0;
direction: rtl
}
.aioseop_help_text_link,
.aioseop_help_text_link:active {
text-align: right;
float: right
}
.aioseop_help_text_link span {
left: -60px;
}
.aioseop_meta_box_help > label {
margin-left: 0;
margin-right: 8px
}
.aioseop_help_text_link img {
float: left
}
.aioseop_meta_box_help,
.aioseop_meta_box_help:active {
float: left;
padding-left: 0;
margin-right: 0;
margin-left: 64px
}
.aioseop_label {
padding-left: 0;
padding-right: 20px;
text-align: right;
direction: rtl
}
.aioseop input[type="text"] {
padding: 2px 10px 2px 0
}
.aioseop textarea {
padding: 10px 10px 0 0
}
.aioseop_help_text_div {
text-align: right;
margin: 8px 0 10px 0
}
.aioseop_help_text {
float: right;
clear: right
}
.aioseop_head_nav {
float: right
}
.aioseop_head_nav_tab {
margin: 0 15px 0 0;
float: right
}
.aioseop_head_nav_tab:first-child {
margin-right: 0
}
.aioseop_header {
float: right;
clear: right
}
.aioseop_nopad {
padding-right: 0
}
.aioseop_adverts {
float: left
}
.aioseop_content {
clear: right
}
#aiosp_feature_manager_metabox.postbox {
float: right
}
.aioseop_sidebar {
margin-left: 0;
margin-right: 10px
}
.aioseop_option_label {
float: right !important;
clear: right !important;
}
.aioseop_settings_left {
float: right;
}
.aioseop_option_input {
float: left; /*clear: right !important;*/
padding-left: 0;
padding-right: 1px;
margin-bottom: 20px;
width: 60%;
min-width: 160px;
}
.aioseop_top {
margin: 10px 0 0 10px
}
.aioseop_right_sidebar {
float: left
}
div.aioseop_feature {
float: right
}
.aioseop_feature #free-flag {
float: left;
margin-right: 0;
background: none repeat scroll 0 0 #D23D46;
color: #FFFFFF;
padding: 5px 12px;
position: relative;
}
.aioseop_feature #free-flag:before,
.aioseop_feature #free-flag:after {
display: none;
}
.aioseop_feature .feature_button {
float: left;
margin-right: 0;
margin-left: 10px
}
.aioseop_follow_button {
margin-right: 0;
margin-left: 5px
}
.aioseop_wrapper {
padding-left: 0;
padding-right: 5px;
direction: rtl
}
.aioseop_input {
clear: left
}
#aiosp div.preview_snippet {
padding: 15px 7px 20px 15px
}
#aiosp_sitemap_addl_pages,
#aiosp_video_sitemap_addl_pages {
clear: right;
margin-left: 0;
margin-right: 20px
}
.All_in_One_SEO_Pack_Opengraph table.aioseop_table {
border-left: 0 solid #dfdfdf;
border-right: 1px solid #dfdfdf
}
.All_in_One_SEO_Pack_Opengraph table.aioseop_table th {
border-right: 0 solid #dfdfdf;
border-left: 1px solid #dfdfdf
}
.All_in_One_SEO_Pack_Opengraph table.aioseop_table td {
border-right: 0 solid #dfdfdf;
border-left: 1px solid #dfdfdf
}
#aiosp_sitemap_addl_pages_metabox table.aioseop_table td,
#aiosp_video_sitemap_addl_pages_metabox table.aioseop_table td {
padding-left: 0;
padding-right: 5%
}
.aioseop_settings_left .postbox {
float: right
}
.aioseop_option_setting_label {
padding-left: 0;
padding-right: 1px
}
.aioseop_settings_left .postbox .inside {
clear: left
}
.postbox h2 .Taha {
float: left !important;
}
#aiosp_settings_form .aioseop_no_label,
.aioseop_no_label {
float: right;
margin: 0 13px 0 23px
}
.aioseop_module.error.below-h2 {
margin: 0 0 15px 477px !important
}
.robots img {
margin: 0 2px 0 0
}
/* Robots.txt styling */
#aiosp_robots_generator_robotgen_wrapper .aioseop_option_div,
#aiosp_robots_generator_robothtml_wrapper .aioseop_option_div {
margin-top: 10px;
}
div.aioseop_notice a.aioseop_dismiss_link {
position: absolute;
top: 10px;
left: 10px;
text-align: left;
}
/*
.ButtonB{
border: 1px solid red !important;
float: left;
clear: right;
}*/
.aioseop_help_text ul {
margin: 15px 20px 0 0
}
.aioseop_header_tabs li a.aioseop_header_tab {
margin: 5px 0 0 5px
}
.aioseop_header_tabs li:first-child a.aioseop_header_tab {
border-left: solid 0 #CCC;
border-right: solid 1px #CCC;
margin-left: 0;
margin-right: 5px
}
.aioseop_tab {
padding-left: 0;
padding-right: 5px
}
form#aiosp_settings_form,
.aioseop_tabs_div {
padding-right: 0;
padding-left: 477px
}
#aiosp_settings_form ul.sfwd_debug_settings li strong {
float: right;
text-align: left;
margin-right: 0;
margin-left: 8px;
padding-right: 0;
padding-left: 8px
}
#aiosp_settings_form ul.sfwd_debug_settings li {
clear: right
}
.aioseop_advert {
direction: rtl;
float: right;
z-index: 999999
}
.aioseop_advert form input {
float: left
}
.MRL {
margin-left: 0 !important;
margin-right: 20px !important;
}
.aioseop_upload_image_label {
clear: right !important;
float: none !important;
}
.aioseop_upload_image_button {
float: right !important;
margin-bottom: 5px !important;
}
#aioseop-about .aioseop_metabox_text ul {
padding-right: 15px;
}

File diff suppressed because it is too large Load Diff

@ -0,0 +1,129 @@
h2.nav-tab-wrapper {
margin:22px 0 0 0;
}
#sections {
padding:22px;
background: #fff;
border:1px solid #ccc;
border-top:0px;
}
section {
display:none;
}
section:first-child {
display:block;
}
.no-js h2.nav-tab-wrapper {
display:none;
}
.no-js #sections {
border-top:1px solid #ccc;
margin-top:22px;
}
.no-js section {
border-top: 1px dashed #aaa;
margin-top:22px;
padding-top:22px;
}
.no-js section:first-child {
margin:0px;
padding:0px;
border:0px;
}
.nav-tab-active {
background-color:white;
}
/* Welcome Panel */
.welcome-panel-close {
display: none;
}
.welcome-panel-close {
z-index: 2;
}
.welcome-panel .welcome-widgets-menus:before,
.welcome-panel .welcome-comments:before,
.welcome-panel .welcome-learn-more:before{
content: '';
}
.welcome-panel .welcome-widgets-menus {
background: url(/path/to/icon) 0 50% no-repeat;
}
.welcome-panel .welcome-comments {
background: url(/path/to/icon) 0 50% no-repeat;
}
.welcome-panel .welcome-learn-more {
background: url(/path/to/icon) 0 50% no-repeat;
}
/*
* Welcome Panel
*/
#welcome-panel > p {
margin-left: 15px;
}
.welcome-panel-column {
width: 30%;
margin-right: 3%;
display: inline-block;
vertical-align: top;
}
.welcome-panel-column:last-child {
margin-right: 0;
}
.welcome-panel-column p.aioseop-message {
width: 70%;
display: inline-block;
vertical-align: top;
}
.welcome-panel-column p.call-to-action {
display: inline-block;
width: 25%;
vertical-align: top;
margin-left: 3%;
margin-top: 13px;
}
.welcome-panel-column p.call-to-action .button-orange {
background: #d54e21;
border-color: #d54e21;
-webkit-box-shadow: 0 1px 0 #d54e21;
box-shadow: 0 1px 0 #d54e21;
color: #fff;
text-decoration: none;
text-shadow: 0 -1px 1px #d54e21,1px 0 1px #d54e21,0 1px 1px #d54e21,-1px 0 1px #d54e21;
}
.welcome-panel-column ul {
margin-left: 20px;
}
.welcome-panel-column ul li {
margin-bottom: 12px;
list-style-type: square;
}
@media screen and (max-width: 850px) {
.welcome-panel-column {
width: 100%;
margin-right: 0;
display: block;
}
}

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 715 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 183 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 648 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 630 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 732 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

@ -0,0 +1,450 @@
<?php
/**
* @package All-in-One-SEO-Pack
*/
$UTF8_TABLES = Array();
$UTF8_TABLES['strtolower'] = array(
"Z" => "z", "Y" => "y", "X" => "x",
"W" => "w", "V" => "v", "U" => "u",
"T" => "t", "S" => "s", "R" => "r",
"Q" => "q", "P" => "p", "O" => "o",
"N" => "n", "M" => "m", "L" => "l",
"K" => "k", "J" => "j", "I" => "i",
"H" => "h", "G" => "g", "F" => "f",
"E" => "e", "D" => "d", "C" => "c",
"B" => "b", "A" => "a", "Å" => "å",
"K" => "k", "Ω" => "ω", "Ώ" => "ώ",
"·ø∫" => "·Ωº", "·øπ" => "·Ωπ", "·ø∏" => "·Ω∏",
"·ø¨" => "·ø•", "·ø´" => "·Ωª", "·ø™" => "·Ω∫",
"·ø©" => "·ø°", "·ø®" => "·ø ", "·øõ" => "·Ω∑",
"·øö" => "·Ω∂", "·øô" => "·øë", "·øò" => "·øê",
"·øã" => "·Ωµ", "·øä" => "·Ω¥", "·øâ" => "·Ω≥",
"Ὲ" => "ὲ", "Ά" => "ά", "Ὰ" => "ὰ",
"·æπ" => "·æ±", "·æ∏" => "·æ∞", "·ΩØ" => "·Ωß",
"·ΩÆ" => "·Ω¶", "·Ω≠" => "·Ω•", "·Ω¨" => "·Ω§",
"·Ω´" => "·Ω£", "·Ω™" => "·Ω¢", "·Ω©" => "·Ω°",
"·Ω®" => "·Ω ", "·Ωü" => "·Ωó", "·Ωù" => "·Ωï",
"·Ωõ" => "·Ωì", "·Ωô" => "·Ωë", "·Ωç" => "·ΩÖ",
"·Ωå" => "·ΩÑ", "·Ωã" => "·ΩÉ", "·Ωä" => "·ΩÇ",
"Ὁ" => "ὁ", "Ὀ" => "ὀ", "Ἷ" => "ἷ",
"Ἶ" => "ἶ", "Ἵ" => "ἵ", "Ἴ" => "ἴ",
"Ἳ" => "ἳ", "Ἲ" => "ἲ", "Ἱ" => "ἱ",
"Ἰ" => "ἰ", "Ἧ" => "ἧ", "Ἦ" => "ἦ",
"Ἥ" => "ἥ", "Ἤ" => "ἤ", "Ἣ" => "ἣ",
"Ἢ" => "ἢ", "Ἡ" => "ἡ", "Ἠ" => "ἠ",
"Ἕ" => "ἕ", "Ἔ" => "ἔ", "Ἓ" => "ἓ",
"Ἒ" => "ἒ", "Ἑ" => "ἑ", "Ἐ" => "ἐ",
"Ἇ" => "ἇ", "Ἆ" => "ἆ", "Ἅ" => "ἅ",
"Ἄ" => "ἄ", "Ἃ" => "ἃ", "Ἂ" => "ἂ",
"Ἁ" => "ἁ", "Ἀ" => "ἀ", "Ỹ" => "ỹ",
"Ỷ" => "ỷ", "Ỵ" => "ỵ", "Ỳ" => "ỳ",
"Ự" => "ự", "Ữ" => "ữ", "Ử" => "ử",
"Ừ" => "ừ", "Ứ" => "ứ", "Ủ" => "ủ",
"Ụ" => "ụ", "Ợ" => "ợ", "Ỡ" => "ỡ",
"Ở" => "ở", "Ờ" => "ờ", "Ớ" => "ớ",
"Ộ" => "ộ", "Ỗ" => "ỗ", "Ổ" => "ổ",
"Ồ" => "ồ", "Ố" => "ố", "Ỏ" => "ỏ",
"Ọ" => "ọ", "Ị" => "ị", "Ỉ" => "ỉ",
"Ệ" => "ệ", "Ễ" => "ễ", "Ể" => "ể",
"Ề" => "ề", "Ế" => "ế", "Ẽ" => "ẽ",
"Ẻ" => "ẻ", "Ẹ" => "ẹ", "Ặ" => "ặ",
"·∫¥" => "·∫µ", "·∫≤" => "·∫≥", "·∫∞" => "·∫±",
"Ắ" => "ắ", "Ậ" => "ậ", "Ẫ" => "ẫ",
"Ẩ" => "ẩ", "Ầ" => "ầ", "Ấ" => "ấ",
"Ả" => "ả", "Ạ" => "ạ", "Ẕ" => "ẕ",
"Ẓ" => "ẓ", "Ẑ" => "ẑ", "Ẏ" => "ẏ",
"Ẍ" => "ẍ", "Ẋ" => "ẋ", "Ẉ" => "ẉ",
"Ẇ" => "ẇ", "Ẅ" => "ẅ", "Ẃ" => "ẃ",
"Ẁ" => "ẁ", "Ṿ" => "ṿ", "Ṽ" => "ṽ",
"·π∫" => "·πª", "·π∏" => "·ππ", "·π∂" => "·π∑",
"·π¥" => "·πµ", "·π≤" => "·π≥", "·π∞" => "·π±",
"Ṯ" => "ṯ", "Ṭ" => "ṭ", "Ṫ" => "ṫ",
"·π®" => "·π©", "·π¶" => "·πß", "·π§" => "·π•",
"·π¢" => "·π£", "·π " => "·π°", "·πû" => "·πü",
"·πú" => "·πù", "·πö" => "·πõ", "·πò" => "·πô",
"·πñ" => "·πó", "·πî" => "·πï", "·πí" => "·πì",
"·πê" => "·πë", "·πé" => "·πè", "·πå" => "·πç",
"Ṋ" => "ṋ", "Ṉ" => "ṉ", "Ṇ" => "ṇ",
"Ṅ" => "ṅ", "Ṃ" => "ṃ", "Ṁ" => "ṁ",
"Ḿ" => "ḿ", "Ḽ" => "ḽ", "Ḻ" => "ḻ",
"·∏∏" => "·∏π", "·∏∂" => "·∏∑", "·∏¥" => "·∏µ",
"Ḳ" => "ḳ", "Ḱ" => "ḱ", "Ḯ" => "ḯ",
"Ḭ" => "ḭ", "Ḫ" => "ḫ", "Ḩ" => "ḩ",
"Ḧ" => "ḧ", "Ḥ" => "ḥ", "Ḣ" => "ḣ",
"Ḡ" => "ḡ", "Ḟ" => "ḟ", "Ḝ" => "ḝ",
"Ḛ" => "ḛ", "Ḙ" => "ḙ", "Ḗ" => "ḗ",
"Ḕ" => "ḕ", "Ḓ" => "ḓ", "Ḑ" => "ḑ",
"Ḏ" => "ḏ", "Ḍ" => "ḍ", "Ḋ" => "ḋ",
"Ḉ" => "ḉ", "Ḇ" => "ḇ", "Ḅ" => "ḅ",
"Ḃ" => "ḃ", "Ḁ" => "ḁ", "Ֆ" => "ֆ",
"Օ" => "օ", "Ք" => "ք", "Փ" => "փ",
"Ւ" => "ւ", "Ց" => "ց", "Ր" => "ր",
"’è" => "’ø", "’é" => "’æ", "’ç" => "’Ω",
"’å" => "’º", "’ã" => "’ª", "’ä" => "’∫",
"’â" => "’π", "’à" => "’∏", "’á" => "’∑",
"’Ü" => "’∂", "’Ö" => "’µ", "’Ñ" => "’¥",
"’É" => "’≥", "’Ç" => "’≤", "’Å" => "’±",
"’Ä" => "’∞", "‘ø" => "’Ø", "‘æ" => "’Æ",
"Խ" => "խ", "Լ" => "լ", "Ի" => "ի",
"‘∫" => "’™", "‘π" => "’©", "‘∏" => "’®",
"‘∑" => "’ß", "‘∂" => "’¶", "‘µ" => "’•",
"‘¥" => "’§", "‘≥" => "’£", "‘≤" => "’¢",
"‘±" => "’°", "‘é" => "‘è", "‘å" => "‘ç",
"‘ä" => "‘ã", "‘à" => "‘â", "‘Ü" => "‘á",
"‘Ñ" => "‘Ö", "‘Ç" => "‘É", "‘Ä" => "‘Å",
"Ӹ" => "ӹ", "Ӵ" => "ӵ", "Ӳ" => "ӳ",
"Ӱ" => "ӱ", "Ӯ" => "ӯ", "Ӭ" => "ӭ",
"Ӫ" => "ӫ", "Ө" => "ө", "Ӧ" => "ӧ",
"”§" => "”•", "”¢" => "”£", "” " => "”°",
"Ӟ" => "ӟ", "Ӝ" => "ӝ", "Ӛ" => "ӛ",
"Ә" => "ә", "Ӗ" => "ӗ", "Ӕ" => "ӕ",
"Ӓ" => "ӓ", "Ӑ" => "ӑ", "Ӎ" => "ӎ",
"Ӌ" => "ӌ", "Ӊ" => "ӊ", "Ӈ" => "ӈ",
"Ӆ" => "ӆ", "Ӄ" => "ӄ", "Ӂ" => "ӂ",
"Ҿ" => "ҿ", "Ҽ" => "ҽ", "Һ" => "һ",
"“∏" => "“π", "“∂" => "“∑", "“¥" => "“µ",
"“≤" => "“≥", "“∞" => "“±", "“Æ" => "“Ø",
"Ҭ" => "ҭ", "Ҫ" => "ҫ", "Ҩ" => "ҩ",
"Ҧ" => "ҧ", "Ҥ" => "ҥ", "Ң" => "ң",
"“ " => "“°", "“û" => "“ü", "“ú" => "“ù",
"“ö" => "“õ", "“ò" => "“ô", "“ñ" => "“ó",
"“î" => "“ï", "“í" => "“ì", "“ê" => "“ë",
"“é" => "“è", "“å" => "“ç", "“ä" => "“ã",
"“Ä" => "“Å", "—æ" => "—ø", "—º" => "—Ω",
"—∫" => "—ª", "—∏" => "—π", "—∂" => "—∑",
"—¥" => "—µ", "—≤" => "—≥", "—∞" => "—±",
"—Æ" => "—Ø", "—¨" => "—≠", "—™" => "—´",
"—®" => "—©", "—¶" => "—ß", "—§" => "—•",
"—¢" => "—£", "— " => "—°", "–Ø" => "—è",
"–Æ" => "—é", "–≠" => "—ç", "–¨" => "—å",
"–´" => "—ã", "–™" => "—ä", "–©" => "—â",
"–®" => "—à", "–ß" => "—á", "–¶" => "—Ü",
"–•" => "—Ö", "–§" => "—Ñ", "–£" => "—É",
"–¢" => "—Ç", "–°" => "—Å", "– " => "—Ä",
"–ü" => "–ø", "–û" => "–æ", "–ù" => "–Ω",
"–ú" => "–º", "–õ" => "–ª", "–ö" => "–∫",
"–ô" => "–π", "–ò" => "–∏", "–ó" => "–∑",
"–ñ" => "–∂", "–ï" => "–µ", "–î" => "–¥",
"–ì" => "–≥", "–í" => "–≤", "–ë" => "–±",
"–ê" => "–∞", "–è" => "—ü", "–é" => "—û",
"–ç" => "—ù", "–å" => "—ú", "–ã" => "—õ",
"–ä" => "—ö", "–â" => "—ô", "–à" => "—ò",
"–á" => "—ó", "–Ü" => "—ñ", "–Ö" => "—ï",
"–Ñ" => "—î", "–É" => "—ì", "–Ç" => "—í",
"Ё" => "ё", "Ѐ" => "ѐ", "ϴ" => "θ",
"Ϯ" => "ϯ", "Ϭ" => "ϭ", "Ϫ" => "ϫ",
"Ϩ" => "ϩ", "Ϧ" => "ϧ", "Ϥ" => "ϥ",
"œ¢" => "œ£", "œ " => "œ°", "œû" => "œü",
"Ϝ" => "ϝ", "Ϛ" => "ϛ", "Ϙ" => "ϙ",
"Ϋ" => "ϋ", "Ϊ" => "ϊ", "Ω" => "ω",
"Ψ" => "ψ", "Χ" => "χ", "Φ" => "φ",
"Υ" => "υ", "Τ" => "τ", "Σ" => "σ",
"Ρ" => "ρ", "Π" => "π", "Ο" => "ο",
"Ξ" => "ξ", "Ν" => "ν", "Μ" => "μ",
"Λ" => "λ", "Κ" => "κ", "Ι" => "ι",
"Θ" => "θ", "Η" => "η", "Ζ" => "ζ",
"Ε" => "ε", "Δ" => "δ", "Γ" => "γ",
"Β" => "β", "Α" => "α", "Ώ" => "ώ",
"Ύ" => "ύ", "Ό" => "ό", "Ί" => "ί",
"Ή" => "ή", "Έ" => "έ", "Ά" => "ά",
"Ȳ" => "ȳ", "Ȱ" => "ȱ", "Ȯ" => "ȯ",
"Ȭ" => "ȭ", "Ȫ" => "ȫ", "Ȩ" => "ȩ",
"Ȧ" => "ȧ", "Ȥ" => "ȥ", "Ȣ" => "ȣ",
"» " => "∆û", "»û" => "»ü", "»ú" => "»ù",
"Ț" => "ț", "Ș" => "ș", "Ȗ" => "ȗ",
"Ȕ" => "ȕ", "Ȓ" => "ȓ", "Ȑ" => "ȑ",
"Ȏ" => "ȏ", "Ȍ" => "ȍ", "Ȋ" => "ȋ",
"Ȉ" => "ȉ", "Ȇ" => "ȇ", "Ȅ" => "ȅ",
"Ȃ" => "ȃ", "Ȁ" => "ȁ", "Ǿ" => "ǿ",
"Ǽ" => "ǽ", "Ǻ" => "ǻ", "Ǹ" => "ǹ",
"Ƿ" => "ƿ", "Ƕ" => "ƕ", "Ǵ" => "ǵ",
"DZ" => "dz", "Ǯ" => "ǯ", "Ǭ" => "ǭ",
"Ǫ" => "ǫ", "Ǩ" => "ǩ", "Ǧ" => "ǧ",
"«§" => "«•", "«¢" => "«£", "« " => "«°",
"«û" => "«ü", "«õ" => "«ú", "«ô" => "«ö",
"«ó" => "«ò", "«ï" => "«ñ", "«ì" => "«î",
"«ë" => "«í", "«è" => "«ê", "«ç" => "«é",
"«ä" => "«å", "«á" => "«â", "«Ñ" => "«Ü",
"Ƽ" => "ƽ", "Ƹ" => "ƹ", "Ʒ" => "ʒ",
"∆µ" => "∆∂", "∆≥" => "∆¥", "∆≤" => " ã",
"Ʊ" => "ʊ", "Ư" => "ư", "Ʈ" => "ʈ",
"Ƭ" => "ƭ", "Ʃ" => "ʃ", "Ƨ" => "ƨ",
"Ʀ" => "ʀ", "Ƥ" => "ƥ", "Ƣ" => "ƣ",
"∆ " => "∆°", "∆ü" => "…µ", "∆ù" => "…≤",
"∆ú" => "…Ø", "∆ò" => "∆ô", "∆ó" => "…®",
"∆ñ" => "…©", "∆î" => "…£", "∆ì" => "… ",
"Ƒ" => "ƒ", "Ɛ" => "ɛ", "Ə" => "ə",
"Ǝ" => "ǝ", "Ƌ" => "ƌ", "Ɗ" => "ɗ",
"Ɖ" => "ɖ", "Ƈ" => "ƈ", "Ɔ" => "ɔ",
"Ƅ" => "ƅ", "Ƃ" => "ƃ", "Ɓ" => "ɓ",
"Ž" => "ž", "Ż" => "ż", "Ź" => "ź",
"Ÿ" => "ÿ", "Ŷ" => "ŷ", "Ŵ" => "ŵ",
"Ų" => "ų", "Ű" => "ű", "Ů" => "ů",
"Ŭ" => "ŭ", "Ū" => "ū", "Ũ" => "ũ",
"Ŧ" => "ŧ", "Ť" => "ť", "Ţ" => "ţ",
"Š" => "š", "Ş" => "ş", "Ŝ" => "ŝ",
"Ś" => "ś", "Ř" => "ř", "Ŗ" => "ŗ",
"Ŕ" => "ŕ", "Œ" => "œ", "Ő" => "ő",
"Ŏ" => "ŏ", "Ō" => "ō", "Ŋ" => "ŋ",
"Ň" => "ň", "Ņ" => "ņ", "Ń" => "ń",
"Ł" => "ł", "Ŀ" => "ŀ", "Ľ" => "ľ",
"Ļ" => "ļ", "Ĺ" => "ĺ", "Ķ" => "ķ",
"Ĵ" => "ĵ", "IJ" => "ij", "İ" => "i",
"Į" => "į", "Ĭ" => "ĭ", "Ī" => "ī",
"Ĩ" => "ĩ", "Ħ" => "ħ", "Ĥ" => "ĥ",
"ƒ¢" => "ƒ£", "ƒ " => "ƒ°", "ƒû" => "ƒü",
"ƒú" => "ƒù", "ƒö" => "ƒõ", "ƒò" => "ƒô",
"Ė" => "ė", "Ĕ" => "ĕ", "Ē" => "ē",
"Đ" => "đ", "Ď" => "ď", "Č" => "č",
"Ċ" => "ċ", "Ĉ" => "ĉ", "Ć" => "ć",
"Ą" => "ą", "Ă" => "ă", "Ā" => "ā",
"Þ" => "þ", "Ý" => "ý", "Ü" => "ü",
"Û" => "û", "Ú" => "ú", "Ù" => "ù",
"Ø" => "ø", "Ö" => "ö", "Õ" => "õ",
"Ô" => "ô", "Ó" => "ó", "Ò" => "ò",
"Ñ" => "ñ", "Ð" => "ð", "Ï" => "ï",
"Î" => "î", "Í" => "í", "Ì" => "ì",
"Ë" => "ë", "Ê" => "ê", "É" => "é",
"È" => "è", "Ç" => "ç", "Æ" => "æ",
"Å" => "å", "Ä" => "ä", "Ã" => "ã",
"Â" => "â", "Á" => "á", "À" => "à ",
"Z" => "z", "Y" => "y", "X" => "x",
"W" => "w", "V" => "v", "U" => "u",
"T" => "t", "S" => "s", "R" => "r",
"Q" => "q", "P" => "p", "O" => "o",
"N" => "n", "M" => "m", "L" => "l",
"K" => "k", "J" => "j", "I" => "i",
"H" => "h", "G" => "g", "F" => "f",
"E" => "e", "D" => "d", "C" => "c",
"B" => "b", "A" => "a",
);
$UTF8_TABLES['strtoupper'] = array(
"z" => "Z", "y" => "Y", "x" => "X",
"w" => "W", "v" => "V", "u" => "U",
"t" => "T", "s" => "S", "r" => "R",
"q" => "Q", "p" => "P", "o" => "O",
"n" => "N", "m" => "M", "l" => "L",
"k" => "K", "j" => "J", "i" => "I",
"h" => "H", "g" => "G", "f" => "F",
"e" => "E", "d" => "D", "c" => "C",
"b" => "B", "a" => "A", "ῳ" => "ῼ",
"·ø•" => "·ø¨", "·ø°" => "·ø©", "·ø " => "·ø®",
"·øë" => "·øô", "·øê" => "·øò", "·øÉ" => "·øå",
"ι" => "Ι", "ᾳ" => "ᾼ", "ᾱ" => "Ᾱ",
"ᾰ" => "Ᾰ", "ᾧ" => "ᾯ", "ᾦ" => "ᾮ",
"ᾥ" => "ᾭ", "ᾤ" => "ᾬ", "ᾣ" => "ᾫ",
"ᾢ" => "ᾪ", "ᾡ" => "ᾩ", "ᾠ" => "ᾨ",
"·æó" => "·æü", "·æñ" => "·æû", "·æï" => "·æù",
"·æî" => "·æú", "·æì" => "·æõ", "·æí" => "·æö",
"·æë" => "·æô", "·æê" => "·æò", "·æá" => "·æè",
"ᾆ" => "ᾎ", "ᾅ" => "ᾍ", "ᾄ" => "ᾌ",
"ᾃ" => "ᾋ", "ᾂ" => "ᾊ", "ᾁ" => "ᾉ",
"ᾀ" => "ᾈ", "ώ" => "Ώ", "ὼ" => "Ὼ",
"·Ωª" => "·ø´", "·Ω∫" => "·ø™", "·Ωπ" => "·øπ",
"·Ω∏" => "·ø∏", "·Ω∑" => "·øõ", "·Ω∂" => "·øö",
"·Ωµ" => "·øã", "·Ω¥" => "·øä", "·Ω≥" => "·øâ",
"ὲ" => "Ὲ", "ά" => "Ά", "ὰ" => "Ὰ",
"·Ωß" => "·ΩØ", "·Ω¶" => "·ΩÆ", "·Ω•" => "·Ω≠",
"·Ω§" => "·Ω¨", "·Ω£" => "·Ω´", "·Ω¢" => "·Ω™",
"·Ω°" => "·Ω©", "·Ω " => "·Ω®", "·Ωó" => "·Ωü",
"·Ωï" => "·Ωù", "·Ωì" => "·Ωõ", "·Ωë" => "·Ωô",
"·ΩÖ" => "·Ωç", "·ΩÑ" => "·Ωå", "·ΩÉ" => "·Ωã",
"·ΩÇ" => "·Ωä", "·ΩÅ" => "·Ωâ", "·ΩÄ" => "·Ωà",
"ἷ" => "Ἷ", "ἶ" => "Ἶ", "ἵ" => "Ἵ",
"ἴ" => "Ἴ", "ἳ" => "Ἳ", "ἲ" => "Ἲ",
"ἱ" => "Ἱ", "ἰ" => "Ἰ", "ἧ" => "Ἧ",
"ἦ" => "Ἦ", "ἥ" => "Ἥ", "ἤ" => "Ἤ",
"ἣ" => "Ἣ", "ἢ" => "Ἢ", "ἡ" => "Ἡ",
"ἠ" => "Ἠ", "ἕ" => "Ἕ", "ἔ" => "Ἔ",
"ἓ" => "Ἓ", "ἒ" => "Ἒ", "ἑ" => "Ἑ",
"ἐ" => "Ἐ", "ἇ" => "Ἇ", "ἆ" => "Ἆ",
"ἅ" => "Ἅ", "ἄ" => "Ἄ", "ἃ" => "Ἃ",
"ἂ" => "Ἂ", "ἁ" => "Ἁ", "ἀ" => "Ἀ",
"ỹ" => "Ỹ", "ỷ" => "Ỷ", "ỵ" => "Ỵ",
"ỳ" => "Ỳ", "ự" => "Ự", "ữ" => "Ữ",
"ử" => "Ử", "ừ" => "Ừ", "ứ" => "Ứ",
"ủ" => "Ủ", "ụ" => "Ụ", "ợ" => "Ợ",
"ỡ" => "Ỡ", "ở" => "Ở", "ờ" => "Ờ",
"ớ" => "Ớ", "ộ" => "Ộ", "ỗ" => "Ỗ",
"ổ" => "Ổ", "ồ" => "Ồ", "ố" => "Ố",
"ỏ" => "Ỏ", "ọ" => "Ọ", "ị" => "Ị",
"ỉ" => "Ỉ", "ệ" => "Ệ", "ễ" => "Ễ",
"ể" => "Ể", "ề" => "Ề", "ế" => "Ế",
"ẽ" => "Ẽ", "ẻ" => "Ẻ", "ẹ" => "Ẹ",
"·∫∑" => "·∫∂", "·∫µ" => "·∫¥", "·∫≥" => "·∫≤",
"ằ" => "Ằ", "ắ" => "Ắ", "ậ" => "Ậ",
"ẫ" => "Ẫ", "ẩ" => "Ẩ", "ầ" => "Ầ",
"ấ" => "Ấ", "ả" => "Ả", "ạ" => "Ạ",
"ẛ" => "Ṡ", "ẕ" => "Ẕ", "ẓ" => "Ẓ",
"ẑ" => "Ẑ", "ẏ" => "Ẏ", "ẍ" => "Ẍ",
"ẋ" => "Ẋ", "ẉ" => "Ẉ", "ẇ" => "Ẇ",
"ẅ" => "Ẅ", "ẃ" => "Ẃ", "ẁ" => "Ẁ",
"·πø" => "·πæ", "·πΩ" => "·πº", "·πª" => "·π∫",
"·ππ" => "·π∏", "·π∑" => "·π∂", "·πµ" => "·π¥",
"ṳ" => "Ṳ", "ṱ" => "Ṱ", "ṯ" => "Ṯ",
"·π≠" => "·π¨", "·π´" => "·π™", "·π©" => "·π®",
"·πß" => "·π¶", "·π•" => "·π§", "·π£" => "·π¢",
"·π°" => "·π ", "·πü" => "·πû", "·πù" => "·πú",
"·πõ" => "·πö", "·πô" => "·πò", "·πó" => "·πñ",
"·πï" => "·πî", "·πì" => "·πí", "·πë" => "·πê",
"·πè" => "·πé", "·πç" => "·πå", "·πã" => "·πä",
"ṉ" => "Ṉ", "ṇ" => "Ṇ", "ṅ" => "Ṅ",
"ṃ" => "Ṃ", "ṁ" => "Ṁ", "ḿ" => "Ḿ",
"ḽ" => "Ḽ", "ḻ" => "Ḻ", "ḹ" => "Ḹ",
"·∏∑" => "·∏∂", "·∏µ" => "·∏¥", "·∏≥" => "·∏≤",
"ḱ" => "Ḱ", "ḯ" => "Ḯ", "ḭ" => "Ḭ",
"ḫ" => "Ḫ", "ḩ" => "Ḩ", "ḧ" => "Ḧ",
"ḥ" => "Ḥ", "ḣ" => "Ḣ", "ḡ" => "Ḡ",
"ḟ" => "Ḟ", "ḝ" => "Ḝ", "ḛ" => "Ḛ",
"ḙ" => "Ḙ", "ḗ" => "Ḗ", "ḕ" => "Ḕ",
"ḓ" => "Ḓ", "ḑ" => "Ḑ", "ḏ" => "Ḏ",
"ḍ" => "Ḍ", "ḋ" => "Ḋ", "ḉ" => "Ḉ",
"ḇ" => "Ḇ", "ḅ" => "Ḅ", "ḃ" => "Ḃ",
"ḁ" => "Ḁ", "ֆ" => "Ֆ", "օ" => "Օ",
"ք" => "Ք", "փ" => "Փ", "ւ" => "Ւ",
"ց" => "Ց", "ր" => "Ր", "տ" => "Տ",
"’æ" => "’é", "’Ω" => "’ç", "’º" => "’å",
"’ª" => "’ã", "’∫" => "’ä", "’π" => "’â",
"’∏" => "’à", "’∑" => "’á", "’∂" => "’Ü",
"’µ" => "’Ö", "’¥" => "’Ñ", "’≥" => "’É",
"’≤" => "’Ç", "’±" => "’Å", "’∞" => "’Ä",
"’Ø" => "‘ø", "’Æ" => "‘æ", "’≠" => "‘Ω",
"լ" => "Լ", "ի" => "Ի", "ժ" => "Ժ",
"’©" => "‘π", "’®" => "‘∏", "’ß" => "‘∑",
"’¶" => "‘∂", "’•" => "‘µ", "’§" => "‘¥",
"’£" => "‘≥", "’¢" => "‘≤", "’°" => "‘±",
"‘è" => "‘é", "‘ç" => "‘å", "‘ã" => "‘ä",
"‘â" => "‘à", "‘á" => "‘Ü", "‘Ö" => "‘Ñ",
"‘É" => "‘Ç", "‘Å" => "‘Ä", "”π" => "”∏",
"ӵ" => "Ӵ", "ӳ" => "Ӳ", "ӱ" => "Ӱ",
"ӯ" => "Ӯ", "ӭ" => "Ӭ", "ӫ" => "Ӫ",
"ө" => "Ө", "ӧ" => "Ӧ", "ӥ" => "Ӥ",
"”£" => "”¢", "”°" => "” ", "”ü" => "”û",
"”ù" => "”ú", "”õ" => "”ö", "”ô" => "”ò",
"ӗ" => "Ӗ", "ӕ" => "Ӕ", "ӓ" => "Ӓ",
"ӑ" => "Ӑ", "ӎ" => "Ӎ", "ӌ" => "Ӌ",
"ӊ" => "Ӊ", "ӈ" => "Ӈ", "ӆ" => "Ӆ",
"ӄ" => "Ӄ", "ӂ" => "Ӂ", "ҿ" => "Ҿ",
"ҽ" => "Ҽ", "һ" => "Һ", "ҹ" => "Ҹ",
"“∑" => "“∂", "“µ" => "“¥", "“≥" => "“≤",
"ұ" => "Ұ", "ү" => "Ү", "ҭ" => "Ҭ",
"ҫ" => "Ҫ", "ҩ" => "Ҩ", "ҧ" => "Ҧ",
"“•" => "“§", "“£" => "“¢", "“°" => "“ ",
"“ü" => "“û", "“ù" => "“ú", "“õ" => "“ö",
"“ô" => "“ò", "“ó" => "“ñ", "“ï" => "“î",
"“ì" => "“í", "“ë" => "“ê", "“è" => "“é",
"“ç" => "“å", "“ã" => "“ä", "“Å" => "“Ä",
"—ø" => "—æ", "—Ω" => "—º", "—ª" => "—∫",
"—π" => "—∏", "—∑" => "—∂", "—µ" => "—¥",
"—≥" => "—≤", "—±" => "—∞", "—Ø" => "—Æ",
"—≠" => "—¨", "—´" => "—™", "—©" => "—®",
"—ß" => "—¶", "—•" => "—§", "—£" => "—¢",
"—°" => "— ", "—ü" => "–è", "—û" => "–é",
"—ù" => "–ç", "—ú" => "–å", "—õ" => "–ã",
"—ö" => "–ä", "—ô" => "–â", "—ò" => "–à",
"—ó" => "–á", "—ñ" => "–Ü", "—ï" => "–Ö",
"—î" => "–Ñ", "—ì" => "–É", "—í" => "–Ç",
"—ë" => "–Å", "—ê" => "–Ä", "—è" => "–Ø",
"—é" => "–Æ", "—ç" => "–≠", "—å" => "–¨",
"—ã" => "–´", "—ä" => "–™", "—â" => "–©",
"—à" => "–®", "—á" => "–ß", "—Ü" => "–¶",
"—Ö" => "–•", "—Ñ" => "–§", "—É" => "–£",
"—Ç" => "–¢", "—Å" => "–°", "—Ä" => "– ",
"–ø" => "–ü", "–æ" => "–û", "–Ω" => "–ù",
"–º" => "–ú", "–ª" => "–õ", "–∫" => "–ö",
"–π" => "–ô", "–∏" => "–ò", "–∑" => "–ó",
"–∂" => "–ñ", "–µ" => "–ï", "–¥" => "–î",
"–≥" => "–ì", "–≤" => "–í", "–±" => "–ë",
"а" => "А", "ϵ" => "Ε", "ϲ" => "Σ",
"ϱ" => "Ρ", "ϰ" => "Κ", "ϯ" => "Ϯ",
"ϭ" => "Ϭ", "ϫ" => "Ϫ", "ϩ" => "Ϩ",
"ϧ" => "Ϧ", "ϥ" => "Ϥ", "ϣ" => "Ϣ",
"œ°" => "œ ", "œü" => "œû", "œù" => "œú",
"ϛ" => "Ϛ", "ϙ" => "Ϙ", "ϖ" => "Π",
"ϕ" => "Φ", "ϑ" => "Θ", "ϐ" => "Β",
"ώ" => "Ώ", "ύ" => "Ύ", "ό" => "Ό",
"ϋ" => "Ϋ", "ϊ" => "Ϊ", "ω" => "Ω",
"ψ" => "Ψ", "χ" => "Χ", "φ" => "Φ",
"υ" => "Υ", "τ" => "Τ", "σ" => "Σ",
"ς" => "Σ", "ρ" => "Ρ", "π" => "Π",
"ο" => "Ο", "ξ" => "Ξ", "ν" => "Ν",
"μ" => "Μ", "λ" => "Λ", "κ" => "Κ",
"ι" => "Ι", "θ" => "Θ", "η" => "Η",
"ζ" => "Ζ", "ε" => "Ε", "δ" => "Δ",
"γ" => "Γ", "β" => "Β", "α" => "Α",
"ί" => "Ί", "ή" => "Ή", "έ" => "Έ",
"ά" => "Ά", "ʒ" => "Ʒ", "ʋ" => "Ʋ",
"ʊ" => "Ʊ", "ʈ" => "Ʈ", "ʃ" => "Ʃ",
"ʀ" => "Ʀ", "ɵ" => "Ɵ", "ɲ" => "Ɲ",
"ɯ" => "Ɯ", "ɩ" => "Ɩ", "ɨ" => "Ɨ",
"…£" => "∆î", "… " => "∆ì", "…õ" => "∆ê",
"ə" => "Ə", "ɗ" => "Ɗ", "ɖ" => "Ɖ",
"ɔ" => "Ɔ", "ɓ" => "Ɓ", "ȳ" => "Ȳ",
"ȱ" => "Ȱ", "ȯ" => "Ȯ", "ȭ" => "Ȭ",
"ȫ" => "Ȫ", "ȩ" => "Ȩ", "ȧ" => "Ȧ",
"ȥ" => "Ȥ", "ȣ" => "Ȣ", "ȟ" => "Ȟ",
"»ù" => "»ú", "»õ" => "»ö", "»ô" => "»ò",
"ȗ" => "Ȗ", "ȕ" => "Ȕ", "ȓ" => "Ȓ",
"ȑ" => "Ȑ", "ȏ" => "Ȏ", "ȍ" => "Ȍ",
"ȋ" => "Ȋ", "ȉ" => "Ȉ", "ȇ" => "Ȇ",
"ȅ" => "Ȅ", "ȃ" => "Ȃ", "ȁ" => "Ȁ",
"ǿ" => "Ǿ", "ǽ" => "Ǽ", "ǻ" => "Ǻ",
"«π" => "«∏", "«µ" => "«¥", "«≥" => "«≤",
"ǯ" => "Ǯ", "ǭ" => "Ǭ", "ǫ" => "Ǫ",
"ǩ" => "Ǩ", "ǧ" => "Ǧ", "ǥ" => "Ǥ",
"«£" => "«¢", "«°" => "« ", "«ü" => "«û",
"ǝ" => "Ǝ", "ǜ" => "Ǜ", "ǚ" => "Ǚ",
"«ò" => "«ó", "«ñ" => "«ï", "«î" => "«ì",
"«í" => "«ë", "«ê" => "«è", "«é" => "«ç",
"«å" => "«ã", "«â" => "«à", "«Ü" => "«Ö",
"ƿ" => "Ƿ", "ƽ" => "Ƽ", "ƹ" => "Ƹ",
"ƶ" => "Ƶ", "ƴ" => "Ƴ", "ư" => "Ư",
"ƭ" => "Ƭ", "ƨ" => "Ƨ", "ƥ" => "Ƥ",
"∆£" => "∆¢", "∆°" => "∆ ", "∆û" => "» ",
"ƙ" => "Ƙ", "ƕ" => "Ƕ", "ƒ" => "Ƒ",
"ƌ" => "Ƌ", "ƈ" => "Ƈ", "ƅ" => "Ƅ",
"ƃ" => "Ƃ", "ſ" => "S", "ž" => "Ž",
"ż" => "Ż", "ź" => "Ź", "ŷ" => "Ŷ",
"≈µ" => "≈¥", "≈≥" => "≈≤", "≈±" => "≈∞",
"ů" => "Ů", "ŭ" => "Ŭ", "ū" => "Ū",
"ũ" => "Ũ", "ŧ" => "Ŧ", "ť" => "Ť",
"ţ" => "Ţ", "š" => "Š", "ş" => "Ş",
"≈ù" => "≈ú", "≈õ" => "≈ö", "≈ô" => "≈ò",
"ŗ" => "Ŗ", "ŕ" => "Ŕ", "œ" => "Œ",
"ő" => "Ő", "ŏ" => "Ŏ", "ō" => "Ō",
"ŋ" => "Ŋ", "ň" => "Ň", "ņ" => "Ņ",
"ń" => "Ń", "ł" => "Ł", "ŀ" => "Ŀ",
"ľ" => "Ľ", "ļ" => "Ļ", "ĺ" => "Ĺ",
"ķ" => "Ķ", "ĵ" => "Ĵ", "ij" => "IJ",
"ı" => "I", "į" => "Į", "ĭ" => "Ĭ",
"ī" => "Ī", "ĩ" => "Ĩ", "ħ" => "Ħ",
"ƒ•" => "ƒ§", "ƒ£" => "ƒ¢", "ƒ°" => "ƒ ",
"ğ" => "Ğ", "ĝ" => "Ĝ", "ě" => "Ě",
"ę" => "Ę", "ė" => "Ė", "ĕ" => "Ĕ",
"ē" => "Ē", "đ" => "Đ", "ď" => "Ď",
"č" => "Č", "ċ" => "Ċ", "ĉ" => "Ĉ",
"ć" => "Ć", "ą" => "Ą", "ă" => "Ă",
"ā" => "Ā", "ÿ" => "Ÿ", "þ" => "Þ",
"ý" => "Ý", "ü" => "Ü", "û" => "Û",
"√∫" => "√ö", "√π" => "√ô", "√∏" => "√ò",
"ö" => "Ö", "õ" => "Õ", "ô" => "Ô",
"ó" => "Ó", "ò" => "Ò", "ñ" => "Ñ",
"ð" => "Ð", "ï" => "Ï", "î" => "Î",
"í" => "Í", "ì" => "Ì", "ë" => "Ë",
"ê" => "Ê", "é" => "É", "è" => "È",
"ç" => "Ç", "æ" => "Æ", "å" => "Å",
"ä" => "Ä", "ã" => "Ã", "â" => "Â",
"á" => "Á", "à " => "À", "µ" => "Μ",
"z" => "Z", "y" => "Y", "x" => "X",
"w" => "W", "v" => "V", "u" => "U",
"t" => "T", "s" => "S", "r" => "R",
"q" => "Q", "p" => "P", "o" => "O",
"n" => "N", "m" => "M", "l" => "L",
"k" => "K", "j" => "J", "i" => "I",
"h" => "H", "g" => "G", "f" => "F",
"e" => "E", "d" => "D", "c" => "C",
"b" => "B", "a" => "A",
);

@ -0,0 +1,958 @@
<?php
/**
* General functions file.
*
* We'll eventually move these to a better place, and figure out ones not being used anymore.
*
* @package All-in-One-SEO-Pack
*/
if ( ! function_exists( 'aioseop_load_modules' ) ) {
/**
* Load the module manager.
*/
function aioseop_load_modules() {
global $aioseop_modules, $aioseop_module_list;
require_once( AIOSEOP_PLUGIN_DIR . 'admin/aioseop_module_manager.php' );
$aioseop_modules = new All_in_One_SEO_Pack_Module_Manager( apply_filters( 'aioseop_module_list', $aioseop_module_list ) );
$aioseop_modules->load_modules();
}
}
if ( ! function_exists( 'aioseop_get_options' ) ) {
/**
* @return mixed|void
*/
function aioseop_get_options() {
global $aioseop_options;
$aioseop_options = get_option( 'aioseop_options' );
$aioseop_options = apply_filters( 'aioseop_get_options', $aioseop_options );
return $aioseop_options;
}
}
if ( ! function_exists( 'aioseop_update_settings_check' ) ) {
/**
* Check if settings need to be updated / migrated from old version.
*
* @TODO See when this is from and if we can move it elsewhere... our new db updates/upgrades class?
*/
function aioseop_update_settings_check() {
global $aioseop_options;
if ( empty( $aioseop_options ) || isset( $_POST['aioseop_migrate_options'] ) ) {
aioseop_mrt_mkarry();
}
// WPML has now attached to filters, read settings again so they can be translated.
aioseop_get_options();
$update_options = false;
if ( ! empty( $aioseop_options ) ) {
if ( ! empty( $aioseop_options['aiosp_archive_noindex'] ) ) { // Migrate setting for noindex archives.
$aioseop_options['aiosp_archive_date_noindex'] = $aioseop_options['aiosp_archive_author_noindex'] = $aioseop_options['aiosp_archive_noindex'];
unset( $aioseop_options['aiosp_archive_noindex'] );
$update_options = true;
}
if ( ! empty( $aioseop_options['aiosp_archive_title_format'] ) && empty( $aioseop_options['aiosp_date_title_format'] ) ) {
$aioseop_options['aiosp_date_title_format'] = $aioseop_options['aiosp_archive_title_format'];
unset( $aioseop_options['aiosp_archive_title_format'] );
$update_options = true;
}
if ( ! empty( $aioseop_options['aiosp_archive_title_format'] ) && ( $aioseop_options['aiosp_archive_title_format'] === '%date% | %blog_title%' ) ) {
$aioseop_options['aiosp_archive_title_format'] = '%archive_title% | %blog_title%';
$update_options = true;
}
if ( $update_options ) {
update_option( 'aioseop_options', $aioseop_options );
}
}
}
}
if ( ! function_exists( 'aioseop_mrt_mkarry' ) ) {
/**
* Initialize settings to defaults.
*
* @TODO Should also move.
*/
function aioseop_mrt_mkarry() {
global $aiosp;
global $aioseop_options;
$naioseop_options = $aiosp->default_options();
if ( get_option( 'aiosp_post_title_format' ) ) {
foreach ( $naioseop_options as $aioseop_opt_name => $value ) {
if ( $aioseop_oldval = get_option( $aioseop_opt_name ) ) {
$naioseop_options[ $aioseop_opt_name ] = $aioseop_oldval;
}
if ( $aioseop_oldval == '' ) {
$naioseop_options[ $aioseop_opt_name ] = '';
}
delete_option( $aioseop_opt_name );
}
}
add_option( 'aioseop_options', $naioseop_options );
$aioseop_options = $naioseop_options;
}
}
if ( ! function_exists( 'aioseop_get_version' ) ) {
/**
* Returns the version.
*
* I'm not sure why we have BOTH a function and a constant for this. -mrt
*
* @return string
*/
function aioseop_get_version() {
return AIOSEOP_VERSION;
}
}
if ( ! function_exists( 'aioseop_option_isset' ) ) {
/**
* Checks if an option isset.
*
* @param $option
*
* @return bool
*/
function aioseop_option_isset( $option ) {
global $aioseop_options;
return ( isset( $aioseop_options[ $option ] ) && $aioseop_options[ $option ] );
}
}
if ( ! function_exists( 'aioseop_addmycolumns' ) ) {
/**
* Adds posttype columns.
*
*/
function aioseop_addmycolumns() {
global $aioseop_options, $pagenow;
$aiosp_posttypecolumns = Array();
if ( ! empty( $aioseop_options ) && ! empty( $aioseop_options['aiosp_posttypecolumns'] ) ) {
$aiosp_posttypecolumns = $aioseop_options['aiosp_posttypecolumns'];
}
if ( ! empty( $pagenow ) && ( $pagenow === 'upload.php' ) ) {
$post_type = 'attachment';
} elseif ( ! isset( $_REQUEST['post_type'] ) ) {
$post_type = 'post';
} else {
$post_type = $_REQUEST['post_type'];
}
if ( is_array( $aiosp_posttypecolumns ) && in_array( $post_type, $aiosp_posttypecolumns ) ) {
add_action( 'admin_head', 'aioseop_admin_head' );
if ( $post_type === 'page' ) {
add_filter( 'manage_pages_columns', 'aioseop_mrt_pcolumns' );
} elseif ( $post_type === 'attachment' ) {
add_filter( 'manage_media_columns', 'aioseop_mrt_pcolumns' );
} else {
add_filter( 'manage_posts_columns', 'aioseop_mrt_pcolumns' );
}
if ( $post_type === 'attachment' ) {
add_action( 'manage_media_custom_column', 'aioseop_mrt_pccolumn', 10, 2 );
} elseif ( is_post_type_hierarchical( $post_type ) ) {
add_action( 'manage_pages_custom_column', 'aioseop_mrt_pccolumn', 10, 2 );
} else {
add_action( 'manage_posts_custom_column', 'aioseop_mrt_pccolumn', 10, 2 );
}
}
}
}
if ( ! function_exists( 'aioseop_mrt_pcolumns' ) ) {
/**
* @param $aioseopc
*
* @return mixed
*/
function aioseop_mrt_pcolumns( $aioseopc ) {
global $aioseop_options;
$aioseopc['seotitle'] = __( 'SEO Title', 'all-in-one-seo-pack' );
$aioseopc['seodesc'] = __( 'SEO Description', 'all-in-one-seo-pack' );
if ( empty( $aioseop_options['aiosp_togglekeywords'] ) ) {
$aioseopc['seokeywords'] = __( 'SEO Keywords', 'all-in-one-seo-pack' );
}
return $aioseopc;
}
}
if ( ! function_exists( 'aioseop_admin_head' ) ) {
function aioseop_admin_head() {
echo '<script type="text/javascript" src="' . AIOSEOP_PLUGIN_URL . 'js/quickedit_functions.js" ></script>';
?>
<style>
.aioseop_edit_button {
margin: 0 0 0 5px;
opacity: 0.6;
width: 12px;
}
.aioseop_edit_link {
display: inline-block;
position: absolute;
}
.aioseop_mpc_SEO_admin_options_edit img {
margin: 3px 2px;
opacity: 0.7;
}
.aioseop_mpc_admin_meta_options {
float: left;
display: block;
opacity: 1;
max-height: 75px;
overflow: hidden;
width: 100%;
}
.aioseop_mpc_admin_meta_options.aio_editing {
max-height: initial;
overflow: visible;
}
.aioseop_mpc_admin_meta_content {
float: left;
width: 100%;
margin: 0 0 10px 0;
}
td.seotitle.column-seotitle,
td.seodesc.column-seodesc,
td.seokeywords.column-seokeywords {
overflow: visible;
}
@media screen and (max-width: 782px) {
body.wp-admin th.column-seotitle, th.column-seodesc, th.column-seokeywords, td.seotitle.column-seotitle, td.seodesc.column-seodesc, td.seokeywords.column-seokeywords {
display: none;
}
}
</style>
<?php wp_print_scripts( Array( 'sack' ) );
?>
<script type="text/javascript">
//<![CDATA[
var aioseopadmin = {
blogUrl: "<?php print get_bloginfo( 'url' ); ?>",
pluginUrl: "<?php print AIOSEOP_PLUGIN_URL; ?>",
requestUrl: "<?php print WP_ADMIN_URL . '/admin-ajax.php' ?>",
imgUrl: "<?php print AIOSEOP_PLUGIN_IMAGES_URL; ?>",
Edit: "<?php _e( 'Edit', 'all-in-one-seo-pack' ); ?>",
Post: "<?php _e( 'Post', 'all-in-one-seo-pack' ); ?>",
Save: "<?php _e( 'Save', 'all-in-one-seo-pack' ); ?>",
Cancel: "<?php _e( 'Cancel', 'all-in-one-seo-pack' ); ?>",
postType: "post",
pleaseWait: "<?php _e( 'Please wait...', 'all-in-one-seo-pack' ); ?>",
slugEmpty: "<?php _e( 'Slug may not be empty!', 'all-in-one-seo-pack' ); ?>",
Revisions: "<?php _e( 'Revisions', 'all-in-one-seo-pack' ); ?>",
Time: "<?php _e( 'Insert time', 'all-in-one-seo-pack' ); ?>"
}
//]]>
</script>
<?php
}
}
if ( ! function_exists( 'aioseop_handle_ignore_notice' ) ) {
function aioseop_handle_ignore_notice() {
if ( ! empty( $_GET ) ) {
global $current_user;
$user_id = $current_user->ID;
if ( ! empty( $_GET['aioseop_reset_notices'] ) ) {
delete_user_meta( $user_id, 'aioseop_ignore_notice' );
}
if ( ! empty( $_GET['aioseop_ignore_notice'] ) ) {
add_user_meta( $user_id, 'aioseop_ignore_notice', $_GET['aioseop_ignore_notice'], false );
}
}
}
}
if ( ! function_exists( 'aioseop_output_notice' ) ) {
/**
* @param $message
* @param string $id
* @param string $class
*
* @return bool
*/
function aioseop_output_notice( $message, $id = '', $class = 'updated fade' ) {
$class = 'aioseop_notice ' . $class;
if ( ! empty( $class ) ) {
$class = ' class="' . esc_attr( $class ) . '"';
}
if ( ! empty( $id ) ) {
$class .= ' id="' . esc_attr( $id ) . '"';
}
$dismiss = ' ';
echo "<div{$class}>" . wp_kses_post( $message ) . '<br class=clear /></div>';
return true;
}
}
if ( ! function_exists( 'aioseop_output_dismissable_notice' ) ) {
/**
* @param $message
* @param string $id
* @param string $class
*
* @return bool
*/
function aioseop_output_dismissable_notice( $message, $id = '', $class = 'updated fade' ) {
global $current_user;
if ( ! empty( $current_user ) ) {
$user_id = $current_user->ID;
$msgid = md5( $message );
$ignore = get_user_meta( $user_id, 'aioseop_ignore_notice' );
if ( ! empty( $ignore ) && in_array( $msgid, $ignore ) ) {
return false;
}
global $wp;
$qa = Array();
wp_parse_str( $_SERVER['QUERY_STRING'], $qa );
$qa['aioseop_ignore_notice'] = $msgid;
$url = '?' . build_query( $qa );
$message = '<p class=alignleft>' . $message . '</p><p class="alignright"><a class="aioseop_dismiss_link" href="' . $url . '">Dismiss</a></p>';
}
return aioseop_output_notice( $message, $id, $class );
}
}
if ( ! function_exists( 'aioseop_ajax_save_meta' ) ) {
function aioseop_ajax_save_meta() {
if ( ! empty( $_POST['_inline_edit'] ) && ( $_POST['_inline_edit'] !== 'undefined' ) ) {
check_ajax_referer( 'inlineeditnonce', '_inline_edit' );
}
$post_id = intval( $_POST['post_id'] );
$new_meta = strip_tags( $_POST['new_meta'] );
$target = $_POST['target_meta'];
check_ajax_referer( 'aioseop_meta_' . $target . '_' . $post_id, '_nonce' );
$result = '';
if ( in_array( $target, Array(
'title',
'description',
'keywords',
) ) && current_user_can( 'edit_post', $post_id )
) {
update_post_meta( $post_id, '_aioseop_' . $target, esc_attr( $new_meta ) );
$result = get_post_meta( $post_id, '_aioseop_' . $target, true );
} else {
die();
}
if ( $result != '' ):
$label = "<label id='aioseop_label_{$target}_{$post_id}'><span style='width: 20px;display: inline-block;'></span>" . $result . '</label>';
else:
$label = "<label id='aioseop_label_{$target}_{$post_id}'></label><span style='width: 20px;display: inline-block;'></span><strong><i>" . __( 'No', 'all-in-one-seo-pack' ) . ' ' . $target . '</i></strong>';
endif;
$nonce = wp_create_nonce( "aioseop_meta_{$target}_{$post_id}" );
$output = '<a id="' . $target . 'editlink' . $post_id . '" class="aioseop_edit_link" href="javascript:void(0);"'
. 'onclick=\'aioseop_ajax_edit_meta_form(' . $post_id . ', "' . $target . '", "' . $nonce . '");return false;\' title="' . __( 'Edit' ) . '">'
. '<img class="aioseop_edit_button" id="aioseop_edit_id" src="' . AIOSEOP_PLUGIN_IMAGES_URL . '/cog_edit.png" /></a> ' . $label;
die( "jQuery('div#aioseop_" . $target . '_' . $post_id . "').fadeOut('fast', function() { var my_label = " . json_encode( $output ) . ";
jQuery('div#aioseop_" . $target . '_' . $post_id . "').html(my_label).fadeIn('fast');
});" );
}
}
if ( ! function_exists( 'aioseop_ajax_init' ) ) {
function aioseop_ajax_init() {
if ( ! empty( $_POST ) && ! empty( $_POST['settings'] ) && ( ! empty( $_POST['nonce-aioseop'] ) || ( ! empty( $_POST['nonce-aioseop-edit'] ) ) ) && ! empty( $_POST['options'] ) ) {
$_POST = stripslashes_deep( $_POST );
$settings = esc_attr( $_POST['settings'] );
if ( ! defined( 'AIOSEOP_AJAX_MSG_TMPL' ) ) {
define( 'AIOSEOP_AJAX_MSG_TMPL', "jQuery('div#aiosp_$settings').fadeOut('fast', function(){jQuery('div#aiosp_$settings').html('%s').fadeIn('fast');});" );
}
if ( ! wp_verify_nonce( $_POST['nonce-aioseop'], 'aioseop-nonce' ) ) {
die( sprintf( AIOSEOP_AJAX_MSG_TMPL, __( 'Unauthorized access; try reloading the page.', 'all-in-one-seo-pack' ) ) );
}
} else {
die( 0 );
}
}
}
/**
* @param $return
* @param $url
* @param $attr
*
* @return mixed
*/
function aioseop_embed_handler_html( $return, $url, $attr ) {
return AIO_ProGeneral::aioseop_embed_handler_html();
}
function aioseop_ajax_update_oembed() {
AIO_ProGeneral::aioseop_ajax_update_oembed();
}
if ( ! function_exists( 'aioseop_ajax_save_url' ) ) {
function aioseop_ajax_save_url() {
aioseop_ajax_init();
$options = Array();
parse_str( $_POST['options'], $options );
foreach ( $options as $k => $v ) {
$_POST[ $k ] = $v;
}
$_POST['action'] = 'aiosp_update_module';
global $aiosp, $aioseop_modules;
aioseop_load_modules();
$aiosp->admin_menu();
if ( ! empty( $_POST['settings'] ) && ( $_POST['settings'] === 'video_sitemap_addl_pages' ) ) {
$module = $aioseop_modules->return_module( 'All_in_One_SEO_Pack_Video_Sitemap' );
} elseif ( ! empty( $_POST['settings'] ) && ( $_POST['settings'] === 'news_sitemap_addl_pages' ) ) {
$module = $aioseop_modules->return_module( 'All_in_One_SEO_Pack_News_Sitemap' );
} else {
$module = $aioseop_modules->return_module( 'All_in_One_SEO_Pack_Sitemap' );
}
$_POST['location'] = null;
$_POST['Submit'] = 'ajax';
$module->add_page_hooks();
$prefix = $module->get_prefix();
$_POST = $module->get_current_options( $_POST, null );
$module->handle_settings_updates( null );
$options = $module->get_current_options( Array(), null );
$output = $module->display_custom_options( '', Array(
'name' => $prefix . 'addl_pages',
'type' => 'custom',
'save' => true,
'value' => $options[ $prefix . 'addl_pages' ],
'attr' => '',
) );
$output = str_replace( "'", "\'", $output );
$output = str_replace( "\n", '\n', $output );
die( sprintf( AIOSEOP_AJAX_MSG_TMPL, $output ) );
}
}
if ( ! function_exists( 'aioseop_ajax_delete_url' ) ) {
function aioseop_ajax_delete_url() {
aioseop_ajax_init();
$options = Array();
$options = esc_attr( $_POST['options'] );
$_POST['action'] = 'aiosp_update_module';
global $aiosp, $aioseop_modules;
aioseop_load_modules();
$aiosp->admin_menu();
$module = $aioseop_modules->return_module( 'All_in_One_SEO_Pack_Sitemap' );
$_POST['location'] = null;
$_POST['Submit'] = 'ajax';
$module->add_page_hooks();
$_POST = (Array) $module->get_current_options( $_POST, null );
if ( ! empty( $_POST['aiosp_sitemap_addl_pages'] ) && is_object( $_POST['aiosp_sitemap_addl_pages'] ) ) {
$_POST['aiosp_sitemap_addl_pages'] = (Array) $_POST['aiosp_sitemap_addl_pages'];
}
if ( ! empty( $_POST['aiosp_sitemap_addl_pages'] ) && ( ! empty( $_POST['aiosp_sitemap_addl_pages'][ $options ] ) ) ) {
unset( $_POST['aiosp_sitemap_addl_pages'][ $options ] );
if ( empty( $_POST['aiosp_sitemap_addl_pages'] ) ) {
$_POST['aiosp_sitemap_addl_pages'] = '';
} else {
$_POST['aiosp_sitemap_addl_pages'] = json_encode( $_POST['aiosp_sitemap_addl_pages'] );
}
$module->handle_settings_updates( null );
$options = $module->get_current_options( Array(), null );
$output = $module->display_custom_options( '', Array(
'name' => 'aiosp_sitemap_addl_pages',
'type' => 'custom',
'save' => true,
'value' => $options['aiosp_sitemap_addl_pages'],
'attr' => '',
) );
$output = str_replace( "'", "\'", $output );
$output = str_replace( "\n", '\n', $output );
} else {
$output = sprintf( __( 'Row %s not found; no rows were deleted.', 'all-in-one-seo-pack' ), esc_attr( $options ) );
}
die( sprintf( AIOSEOP_AJAX_MSG_TMPL, $output ) );
}
}
if ( ! function_exists( 'aioseop_ajax_scan_header' ) ) {
function aioseop_ajax_scan_header() {
$_POST['options'] = 'foo';
aioseop_ajax_init();
$options = Array();
parse_str( $_POST['options'], $options );
foreach ( $options as $k => $v ) {
$_POST[ $k ] = $v;
}
$_POST['action'] = 'aiosp_update_module';
$_POST['location'] = null;
$_POST['Submit'] = 'ajax';
ob_start();
do_action( 'wp' );
global $aioseop_modules;
$module = $aioseop_modules->return_module( 'All_in_One_SEO_Pack_Opengraph' );
wp_head();
$output = ob_get_clean();
global $aiosp;
$output = $aiosp->html_string_to_array( $output );
$meta = '';
$metatags = Array(
'facebook' => Array( 'name' => 'property', 'value' => 'content' ),
'twitter' => Array( 'name' => 'name', 'value' => 'value' ),
'google+' => Array( 'name' => 'itemprop', 'value' => 'content' ),
);
$metadata = Array(
'facebook' => Array(
'title' => 'og:title',
'type' => 'og:type',
'url' => 'og:url',
'thumbnail' => 'og:image',
'sitename' => 'og:site_name',
'key' => 'fb:admins',
'description' => 'og:description',
),
'google+' => Array(
'thumbnail' => 'image',
'title' => 'name',
'description' => 'description',
),
'twitter' => Array(
'card' => 'twitter:card',
'url' => 'twitter:url',
'title' => 'twitter:title',
'description' => 'twitter:description',
'thumbnail' => 'twitter:image',
),
);
if ( ! empty( $output ) && ! empty( $output['head'] ) && ! empty( $output['head']['meta'] ) ) {
foreach ( $output['head']['meta'] as $v ) {
if ( ! empty( $v['@attributes'] ) ) {
$m = $v['@attributes'];
foreach ( $metatags as $type => $tags ) {
if ( ! empty( $m[ $tags['name'] ] ) && ! empty( $m[ $tags['value'] ] ) ) {
foreach ( $metadata[ $type ] as $tk => $tv ) {
if ( $m[ $tags['name'] ] == $tv ) {
$meta .= "<tr><th style='color:red;'>" . sprintf( __( 'Duplicate %s Meta' ), ucwords( $type ) ) . '</th><td>' . ucwords( $tk ) . "</td><td>{$m[$tags['name']]}</td><td>{$m[$tags['value']]}</td></tr>\n";
}
}
}
}
}
}
}
if ( empty( $meta ) ) {
$meta = '<span style="color:green;">' . __( 'No duplicate meta tags found.', 'all-in-one-seo-pack' ) . '</span>';
} else {
$meta = "<table cellspacing=0 cellpadding=0 width=80% class='aioseop_table'><tr class='aioseop_table_header'><th>Meta For Site</th><th>Kind of Meta</th><th>Element Name</th><th>Element Value</th></tr>" . $meta . '</table>';
$meta .= "<p><div class='aioseop_meta_info'><h3 style='padding:5px;margin-bottom:0px;'>" . __( 'What Does This Mean?', 'all-in-one-seo-pack' ) . "</h3><div style='padding:5px;padding-top:0px;'>"
. '<p>' . __( 'All in One SEO Pack has detected that a plugin(s) or theme is also outputting social meta tags on your site. You can view this social meta in the source code of your site (check your browser help for instructions on how to view source code).', 'all-in-one-seo-pack' )
. '</p><p>' . __( 'You may prefer to use the social meta tags that are being output by the other plugin(s) or theme. If so, then you should deactivate this Social Meta feature in All in One SEO Pack Feature Manager.', 'all-in-one-seo-pack' )
. '</p><p>' . __( 'You should avoid duplicate social meta tags. You can use these free tools from Facebook and Twitter to validate your social meta and check for errors:', 'all-in-one-seo-pack' ) . '</p>';
foreach (
Array(
'https://developers.facebook.com/tools/debug',
'https://dev.twitter.com/docs/cards/validation/validator',
) as $link
) {
$meta .= "<a href='{$link}' target='_blank'>{$link}</a><br />";
}
$meta .= '<p>' . __( 'Please refer to the document for each tool for help in using these to debug your social meta.', 'all-in-one-seo-pack' ) . '</div></div>';
}
$output = $meta;
$output = str_replace( "'", "\'", $output );
$output = str_replace( "\n", '\n', $output );
die( sprintf( AIOSEOP_AJAX_MSG_TMPL, $output ) );
}
}
if ( ! function_exists( 'aioseop_ajax_save_settings' ) ) {
function aioseop_ajax_save_settings() {
aioseop_ajax_init();
$options = Array();
parse_str( $_POST['options'], $options );
$_POST = $options;
$_POST['action'] = 'aiosp_update_module';
global $aiosp, $aioseop_modules;
aioseop_load_modules();
$aiosp->admin_menu();
$module = $aioseop_modules->return_module( $_POST['module'] );
unset( $_POST['module'] );
if ( empty( $_POST['location'] ) ) {
$_POST['location'] = null;
}
$_POST['Submit'] = 'ajax';
$module->add_page_hooks();
$output = $module->handle_settings_updates( $_POST['location'] );
if ( AIOSEOPPRO ) {
$output = '<div id="aioseop_settings_header"><div id="message" class="updated fade"><p>' . $output . '</p></div></div><style>body.all-in-one-seo_page_all-in-one-seo-pack-pro-aioseop_feature_manager .aioseop_settings_left { margin-top: 45px !important; }</style>';
} else {
$output = '<div id="aioseop_settings_header"><div id="message" class="updated fade"><p>' . $output . '</p></div></div><style>body.all-in-one-seo_page_all-in-one-seo-pack-aioseop_feature_manager .aioseop_settings_left { margin-top: 45px !important; }</style>';
}
die( sprintf( AIOSEOP_AJAX_MSG_TMPL, $output ) );
}
}
if ( ! function_exists( 'aioseop_ajax_get_menu_links' ) ) {
function aioseop_ajax_get_menu_links() {
aioseop_ajax_init();
$options = Array();
parse_str( $_POST['options'], $options );
$_POST = $options;
$_POST['action'] = 'aiosp_update_module';
global $aiosp, $aioseop_modules;
aioseop_load_modules();
$aiosp->admin_menu();
if ( empty( $_POST['location'] ) ) {
$_POST['location'] = null;
}
$_POST['Submit'] = 'ajax';
$modlist = $aioseop_modules->get_loaded_module_list();
$links = Array();
$link_list = Array();
$link = $aiosp->get_admin_links();
if ( ! empty( $link ) ) {
foreach ( $link as $l ) {
if ( ! empty( $l ) ) {
if ( empty( $link_list[ $l['order'] ] ) ) {
$link_list[ $l['order'] ] = Array();
}
$link_list[ $l['order'] ][ $l['title'] ] = $l['href'];
}
}
}
if ( ! empty( $modlist ) ) {
foreach ( $modlist as $k => $v ) {
$mod = $aioseop_modules->return_module( $v );
if ( is_object( $mod ) ) {
$mod->add_page_hooks();
$link = $mod->get_admin_links();
foreach ( $link as $l ) {
if ( ! empty( $l ) ) {
if ( empty( $link_list[ $l['order'] ] ) ) {
$link_list[ $l['order'] ] = Array();
}
$link_list[ $l['order'] ][ $l['title'] ] = $l['href'];
}
}
}
}
}
if ( ! empty( $link_list ) ) {
ksort( $link_list );
foreach ( $link_list as $ll ) {
foreach ( $ll as $k => $v ) {
$links[ $k ] = $v;
}
}
}
$output = '<ul>';
if ( ! empty( $links ) ) {
foreach ( $links as $k => $v ) {
if ( $k === 'Feature Manager' ) {
$current = ' class="current"';
} else {
$current = '';
}
$output .= "<li{$current}><a href='" . esc_url( $v ) . "'>" . esc_attr( $k ) . '</a></li>';
}
}
$output .= '</ul>';
die( sprintf( "jQuery('{$_POST['target']}').fadeOut('fast', function(){jQuery('{$_POST['target']}').html('%s').fadeIn('fast');});", addslashes( $output ) ) );
}
}
if ( ! function_exists( 'aioseop_mrt_pccolumn' ) ) {
/**
* @param $aioseopcn
* @param $aioseoppi
*/
function aioseop_mrt_pccolumn( $aioseopcn, $aioseoppi ) {
$id = $aioseoppi;
$target = null;
if ( $aioseopcn === 'seotitle' ) {
$target = 'title';
}
if ( $aioseopcn === 'seokeywords' ) {
$target = 'keywords';
}
if ( $aioseopcn === 'seodesc' ) {
$target = 'description';
}
if ( ! $target ) {
return;
}
if ( current_user_can( 'edit_post', $id ) ) { ?>
<div class="aioseop_mpc_admin_meta_container">
<div class="aioseop_mpc_admin_meta_options"
id="aioseop_<?php print $target; ?>_<?php echo $id; ?>"
style="float:left;">
<?php $content = strip_tags( stripslashes( get_post_meta( $id, '_aioseop_' . $target, true ) ) );
if ( ! empty( $content ) ):
$label = "<label id='aioseop_label_{$target}_{$id}'><span style='width: 20px;display: inline-block;'></span>" . $content . '</label>';
else:
$label = "<label id='aioseop_label_{$target}_{$id}'></label><span style='width: 20px;display: inline-block;'></span><strong><i>" . __( 'No', 'all-in-one-seo-pack' ) . ' ' . $target . '</i></strong>';
endif;
$nonce = wp_create_nonce( "aioseop_meta_{$target}_{$id}" );
echo '<a id="' . $target . 'editlink' . $id . '" class="aioseop_edit_link" href="javascript:void(0);" onclick=\'aioseop_ajax_edit_meta_form(' .
$id . ', "' . $target . '", "' . $nonce . '");return false;\' title="' . __( 'Edit' ) . '">'
. "<img class='aioseop_edit_button'
id='aioseop_edit_id'
src='" . AIOSEOP_PLUGIN_IMAGES_URL . "cog_edit.png' /></a> " . $label;
?>
</div>
</div>
<?php }
}
}
if ( ! function_exists( 'aioseop_unprotect_meta' ) ) {
/**
* @param $protected
* @param $meta_key
* @param $meta_type
*
* @return bool
*/
function aioseop_unprotect_meta( $protected, $meta_key, $meta_type ) {
if ( isset( $meta_key ) && ( substr( $meta_key, 0, 9 ) === '_aioseop_' ) ) {
return false;
}
return $protected;
}
}
if ( ! function_exists( 'aioseop_mrt_exclude_this_page' ) ) {
/**
* @param null $url
*
* @return bool
*/
function aioseop_mrt_exclude_this_page( $url = null ) {
static $excluded = false;
if ( $excluded === false ) {
global $aioseop_options;
$ex_pages = '';
if ( isset( $aioseop_options['aiosp_ex_pages'] ) ) {
$ex_pages = trim( $aioseop_options['aiosp_ex_pages'] );
}
if ( ! empty( $ex_pages ) ) {
$excluded = explode( ',', $ex_pages );
if ( ! empty( $excluded ) ) {
foreach ( $excluded as $k => $v ) {
$excluded[ $k ] = trim( $v );
if ( empty( $excluded[ $k ] ) ) {
unset( $excluded[ $k ] );
}
}
}
if ( empty( $excluded ) ) {
$excluded = null;
}
}
}
if ( ! empty( $excluded ) ) {
if ( $url === null ) {
$url = $_SERVER['REQUEST_URI'];
} else {
$url = parse_url( $url );
if ( ! empty( $url['path'] ) ) {
$url = $url['path'];
} else {
return false;
}
}
if ( ! empty( $url ) ) {
foreach ( $excluded as $exedd ) {
if ( $exedd && ( stripos( $url, $exedd ) !== false ) ) {
return true;
}
}
}
}
return false;
}
}
if ( ! function_exists( 'aioseop_add_contactmethods' ) ) {
/**
* @param $contactmethods
*
* @return mixed
*/
function aioseop_add_contactmethods( $contactmethods ) {
global $aioseop_options, $aioseop_modules;
if ( empty( $aioseop_options['aiosp_google_disable_profile'] ) ) {
$contactmethods['googleplus'] = __( 'Google+', 'all-in-one-seo-pack' );
}
if ( ! empty( $aioseop_modules ) && is_object( $aioseop_modules ) ) {
$m = $aioseop_modules->return_module( 'All_in_One_SEO_Pack_Opengraph' );
if ( ( $m !== false ) && is_object( $m ) ) {
if ( $m->option_isset( 'twitter_creator' ) ) {
$contactmethods['twitter'] = __( 'Twitter', 'all-in-one-seo-pack' );
}
if ( $m->option_isset( 'facebook_author' ) ) {
$contactmethods['facebook'] = __( 'Facebook', 'all-in-one-seo-pack' );
}
}
}
return $contactmethods;
}
}
if ( ! function_exists( 'aioseop_localize_script_data' ) ) {
function aioseop_localize_script_data() {
static $loaded = 0;
if ( ! $loaded ) {
$data = apply_filters( 'aioseop_localize_script_data', Array() );
wp_localize_script( 'aioseop-module-script', 'aiosp_data', $data );
$loaded = 1;
}
}
}
if ( ! function_exists( 'aioseop_array_insert_after' ) ) {
/**
* Utility function for inserting elements into associative arrays by key.
*
* @param $arr
* @param $insertKey
* @param $newValues
*
* @return array
*/
function aioseop_array_insert_after( $arr, $insertKey, $newValues ) {
$keys = array_keys( $arr );
$vals = array_values( $arr );
$insertAfter = array_search( $insertKey, $keys ) + 1;
$keys2 = array_splice( $keys, $insertAfter );
$vals2 = array_splice( $vals, $insertAfter );
foreach ( $newValues as $k => $v ) {
$keys[] = $k;
$vals[] = $v;
}
return array_merge( array_combine( $keys, $vals ), array_combine( $keys2, $vals2 ) );
}
}
if ( ! function_exists( 'fnmatch' ) ) {
/**
* Support for fnmatch() doesn't exist on Windows pre PHP 5.3.
*
* @param $pattern
* @param $string
*
* @return int
*/
function fnmatch( $pattern, $string ) {
return preg_match( '#^' . strtr( preg_quote( $pattern, '#' ), array(
'\*' => '.*',
'\?' => '.',
) ) . "$#i", $string );
}
}
if ( ! function_exists('aiosp_log')) {
function aiosp_log ( $log ) {
global $aioseop_options;
if ( ! empty( $aioseop_options ) && isset( $aioseop_options['aiosp_do_log'] ) && $aioseop_options['aiosp_do_log'] ) {
if ( is_array( $log ) || is_object( $log ) ) {
error_log( print_r( $log, true ) );
} else {
error_log( $log );
}
}
}
}
if ( ! function_exists( 'parse_ini_string' ) ) {
/**
* Parse_ini_string() doesn't exist pre PHP 5.3.
*
* @param $string
* @param $process_sections
*
* @return array|bool
*/
function parse_ini_string( $string, $process_sections ) {
if ( ! class_exists( 'parse_ini_filter' ) ) {
/**
* Class parse_ini_filter
*
* Define our filter class.
*/
class parse_ini_filter extends php_user_filter {
static $buf = '';
/**
* The actual filter for parsing.
*
* @param $in
* @param $out
* @param $consumed
* @param $closing
*
* @return int
*/
function filter( $in, $out, &$consumed, $closing ) {
$bucket = stream_bucket_new( fopen( 'php://memory', 'wb' ), self::$buf );
stream_bucket_append( $out, $bucket );
return PSFS_PASS_ON;
}
}
// Register our filter with PHP.
if ( ! stream_filter_register( 'parse_ini', 'parse_ini_filter' ) ) {
return false;
}
}
parse_ini_filter::$buf = $string;
return parse_ini_file( 'php://filter/read=parse_ini/resource=php://memory', $process_sections );
}
}
function aioseop_update_user_visibilitynotice() {
update_user_meta( get_current_user_id(), 'aioseop_visibility_notice_dismissed', true );
}
function aioseop_update_yst_detected_notice() {
update_user_meta( get_current_user_id(), 'aioseop_yst_detected_notice_dismissed', true );
}
function aioseop_woo_upgrade_notice_dismissed() {
update_user_meta( get_current_user_id(), 'aioseop_woo_upgrade_notice_dismissed', true );
}

@ -0,0 +1,268 @@
<?php
/**
* Handles detection of new plugin version updates.
*
* Handles detection of new plugin version updates, migration of old settings,
* new WP core feature support, etc.
* AIOSEOP Updates class.
*
* @package All-in-One-SEO-Pack.
*/
class AIOSEOP_Updates {
/**
* Constructor
*
*/
function __construct() {
}
/**
* Updates version.
*
* @global $aiosp , $aioseop_options.
* @return null
*/
function version_updates() {
global $aiosp, $aioseop_options;
if ( empty( $aioseop_options ) ) {
$aioseop_options = get_option( $aioseop_options );
if ( empty( $aioseop_options ) ) {
// Something's wrong. bail.
return;
}
}
// Last known running plugin version.
$last_active_version = '0.0';
if ( isset( $aioseop_options['last_active_version'] ) ) {
$last_active_version = $aioseop_options['last_active_version'];
}
// Compares version to see which one is the newer.
if ( version_compare( $last_active_version, AIOSEOP_VERSION, '<' ) ) {
// Upgrades based on previous version.
do_action( 'before_doing_aioseop_updates' );
$this->do_version_updates( $last_active_version );
do_action( 'after_doing_aioseop_updates' );
// If we're running Pro, let the Pro updater set the version.
if ( ! AIOSEOPPRO ) {
// Save the current plugin version as the new last_active_version.
$aioseop_options['last_active_version'] = AIOSEOP_VERSION;
$aiosp->update_class_option( $aioseop_options );
}
if( ! is_network_admin() || !isset( $_GET['activate-multi'] ) ) {
//set_transient( '_aioseop_activation_redirect', true, 30 ); // Sets 30 second transient for welcome screen redirect on activation.
}
delete_transient( 'aioseop_feed' );
// add_action( 'admin_init', array( $this, 'aioseop_welcome' ) );
}
/**
* Perform updates that are dependent on external factors, not
* just the plugin version.
*/
$this->do_feature_updates();
}
function aioseop_welcome(){
if ( get_transient( '_aioseop_activation_redirect' ) ) {
delete_transient( '_aioseop_activation_redirect' );
$aioseop_welcome = new aioseop_welcome();
$aioseop_welcome->init( TRUE );
}
}
/**
* Updates version.
*
* TODO: the compare here should be extracted into a function
*
* @global $aioseop_options .
*
* @param String $old_version
*/
function do_version_updates( $old_version ) {
global $aioseop_options;
if (
( ! AIOSEOPPRO && version_compare( $old_version, '2.3.3', '<' ) ) ||
( AIOSEOPPRO && version_compare( $old_version, '2.4.3', '<' ) )
) {
$this->bad_bots_201603();
}
if (
( ! AIOSEOPPRO && version_compare( $old_version, '2.3.4.1', '<' ) ) ||
( AIOSEOPPRO && version_compare( $old_version, '2.4.4.1', '<' ) )
) {
$this->bad_bots_remove_yandex_201604();
}
if (
( ! AIOSEOPPRO && version_compare( $old_version, '2.3.9', '<' ) ) ||
( AIOSEOPPRO && version_compare( $old_version, '2.4.9', '<' ) )
) {
$this->bad_bots_remove_seznambot_201608();
set_transient( '_aioseop_activation_redirect', true, 30 ); // Sets 30 second transient for welcome screen redirect on activation.
}
}
/**
* Removes overzealous 'DOC' entry which is causing false-positive bad
* bot blocking.
*
* @since 2.3.3
* @global $aiosp , $aioseop_options.
*/
function bad_bots_201603() {
global $aiosp, $aioseop_options;
// Remove 'DOC' from bad bots list to avoid false positives.
if ( isset( $aioseop_options['modules']['aiosp_bad_robots_options']['aiosp_bad_robots_blocklist'] ) ) {
$list = $aioseop_options['modules']['aiosp_bad_robots_options']['aiosp_bad_robots_blocklist'];
$list = str_replace( array(
"DOC\r\n",
"DOC\n",
), '', $list );
$aioseop_options['modules']['aiosp_bad_robots_options']['aiosp_bad_robots_blocklist'] = $list;
update_option( 'aioseop_options', $aioseop_options );
$aiosp->update_class_option( $aioseop_options );
if ( isset( $aioseop_options['modules']['aiosp_bad_robots_options']['aiosp_bad_robots_htaccess_rules'] )
&& 'on' === $aioseop_options['modules']['aiosp_bad_robots_options']['aiosp_bad_robots_htaccess_rules']
) {
if ( ! class_exists( 'All_in_One_SEO_Pack_Bad_Robots' ) ) {
require_once(
AIOSEOP_PLUGIN_DIR .
'admin/aioseop_module_class.php'
);
require_once(
AIOSEOP_PLUGIN_DIR .
'modules/aioseop_bad_robots.php'
);
}
$aiosp_reset_htaccess = new All_in_One_SEO_Pack_Bad_Robots;
$aiosp_reset_htaccess->generate_htaccess_blocklist();
}
if ( ! isset( $aioseop_options['modules']['aiosp_bad_robots_options']['aiosp_bad_robots_htaccess_rules'] )
&& extract_from_markers( get_home_path() . '.htaccess', 'Bad Bot Blocker' )
) {
insert_with_markers( get_home_path() . '.htaccess', 'Bad Bot Blocker', '' );
}
}
}
/*
* Functions for specific version milestones.
*/
/**
* Remove 'yandex' entry. This is a major Russian search engine, and no longer needs to be blocked.
*
* @since 2.3.4.1
* @global $aiosp , $aioseop_options.
*/
function bad_bots_remove_yandex_201604() {
global $aiosp, $aioseop_options;
// Remove 'yandex' from bad bots list to avoid false positives.
if ( isset( $aioseop_options['modules']['aiosp_bad_robots_options']['aiosp_bad_robots_blocklist'] ) ) {
$list = $aioseop_options['modules']['aiosp_bad_robots_options']['aiosp_bad_robots_blocklist'];
$list = str_replace( array(
"yandex\r\n",
"yandex\n",
), '', $list );
$aioseop_options['modules']['aiosp_bad_robots_options']['aiosp_bad_robots_blocklist'] = $list;
update_option( 'aioseop_options', $aioseop_options );
$aiosp->update_class_option( $aioseop_options );
if ( isset( $aioseop_options['modules']['aiosp_bad_robots_options']['aiosp_bad_robots_htaccess_rules'] ) && 'on' === $aioseop_options['modules']['aiosp_bad_robots_options']['aiosp_bad_robots_htaccess_rules'] ) {
if ( ! class_exists( 'All_in_One_SEO_Pack_Bad_Robots' ) ) {
require_once( AIOSEOP_PLUGIN_DIR . 'admin/aioseop_module_class.php' );
require_once( AIOSEOP_PLUGIN_DIR . 'modules/aioseop_bad_robots.php' );
}
$aiosp_reset_htaccess = new All_in_One_SEO_Pack_Bad_Robots;
$aiosp_reset_htaccess->generate_htaccess_blocklist();
}
if ( ! isset( $aioseop_options['modules']['aiosp_bad_robots_options']['aiosp_bad_robots_htaccess_rules'] ) && extract_from_markers( get_home_path() . '.htaccess', 'Bad Bot Blocker' ) ) {
insert_with_markers( get_home_path() . '.htaccess', 'Bad Bot Blocker', '' );
}
}
}
/**
* Remove 'SeznamBot' entry.
*
* @since 2.3.8
* @global $aiosp , $aioseop_options.
*/
function bad_bots_remove_seznambot_201608() {
global $aiosp, $aioseop_options;
// Remove 'SeznamBot' from bad bots list to avoid false positives.
if ( isset( $aioseop_options['modules']['aiosp_bad_robots_options']['aiosp_bad_robots_blocklist'] ) ) {
$list = $aioseop_options['modules']['aiosp_bad_robots_options']['aiosp_bad_robots_blocklist'];
$list = str_replace( array(
"SeznamBot\r\n",
"SeznamBot\n",
), '', $list );
$aioseop_options['modules']['aiosp_bad_robots_options']['aiosp_bad_robots_blocklist'] = $list;
update_option( 'aioseop_options', $aioseop_options );
$aiosp->update_class_option( $aioseop_options );
if ( isset( $aioseop_options['modules']['aiosp_bad_robots_options']['aiosp_bad_robots_htaccess_rules'] ) && 'on' === $aioseop_options['modules']['aiosp_bad_robots_options']['aiosp_bad_robots_htaccess_rules'] ) {
if ( ! class_exists( 'All_in_One_SEO_Pack_Bad_Robots' ) ) {
require_once( AIOSEOP_PLUGIN_DIR . 'admin/aioseop_module_class.php' );
require_once( AIOSEOP_PLUGIN_DIR . 'modules/aioseop_bad_robots.php' );
}
$aiosp_reset_htaccess = new All_in_One_SEO_Pack_Bad_Robots;
$aiosp_reset_htaccess->generate_htaccess_blocklist();
}
if ( ! isset( $aioseop_options['modules']['aiosp_bad_robots_options']['aiosp_bad_robots_htaccess_rules'] ) && extract_from_markers( get_home_path() . '.htaccess', 'Bad Bot Blocker' ) ) {
insert_with_markers( get_home_path() . '.htaccess', 'Bad Bot Blocker', '' );
}
}
}
/**
* Updates features.
*
* @return null
*
* if ( ! ( isset( $aioseop_options['version_feature_flags']['FEATURE_NAME'] ) &&
* $aioseop_options['version_feature_flags']['FEATURE_NAME'] === 'yes' ) ) {
* $this->some_feature_update_method(); // sets flag to 'yes' on completion.
*/
public function do_feature_updates() {
global $aioseop_options;
// We don't need to check all the time. Use a transient to limit frequency.
if ( get_site_transient( 'aioseop_update_check_time' ) ) {
return;
}
// If we're running Pro, let the Pro updater set the transient.
if ( ! AIOSEOPPRO ) {
// We haven't checked recently. Reset the timestamp, timeout 6 hours.
set_site_transient(
'aioseop_update_check_time',
time(),
apply_filters( 'aioseop_update_check_time', 3600 * 6 )
);
}
}
}

@ -0,0 +1,3 @@
<?php
// We will eventually put stuff here.

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save