Updates and minor fixes

This commit is contained in:
nikolark committed 2013-06-27 19:24:04 +02:00
1 parent a2fccef226
commit 10d9583024
118 files changed
+2992 -1480

No files matched your search

+1 -1
View File
@@ -8,7 +8,7 @@
<body>
<h1 id="logo">
<a href="http://wordpress.org/"><img alt="WordPress" src="wp-admin/images/wordpress-logo.png" /></a>
<br /> Version 3.5.1
<br /> Version 3.5.2
</h1>
<p style="text-align: center">Semantic Personal Publishing Platform</p>
+5 -1
View File
@@ -34,7 +34,11 @@ include( ABSPATH . 'wp-admin/admin-header.php' );
</h2>
<div class="changelog point-releases">
<h3><?php echo _n( 'Maintenance and Security Release', 'Maintenance and Security Releases', 1 ); ?></h3>
<h3><?php echo _n( 'Maintenance and Security Release', 'Maintenance and Security Releases', 2 ); ?></h3>
<p><?php printf( _n( '<strong>Version %1$s</strong> addressed some security issues and fixed %2$s bug.',
'<strong>Version %1$s</strong> addressed some security issues and fixed %2$s bugs.', 12 ), '3.5.2', number_format_i18n( 12 ) ); ?>
<?php printf( __( 'For more information, see <a href="%s">the release notes</a>.' ), 'http://codex.wordpress.org/Version_3.5.2' ); ?>
</p>
<p><?php printf( _n( '<strong>Version %1$s</strong> addressed some security issues and fixed %2$s bug.',
'<strong>Version %1$s</strong> addressed some security issues and fixed %2$s bugs.', 37 ), '3.5.1', number_format_i18n( 37 ) ); ?>
<?php printf( __( 'For more information, see <a href="%s">the release notes</a>.' ), 'http://codex.wordpress.org/Version_3.5.1' ); ?>
+9 -9
View File
@@ -144,7 +144,7 @@ if ( post_type_supports($post_type, 'trackbacks') )
if ( post_type_supports($post_type, 'custom-fields') )
add_meta_box('postcustom', __('Custom Fields'), 'post_custom_meta_box', null, 'normal', 'core');
do_action('dbx_post_advanced');
do_action('dbx_post_advanced', $post);
if ( post_type_supports($post_type, 'comments') )
add_meta_box('commentstatusdiv', __('Discussion'), 'post_comment_status_meta_box', null, 'normal', 'core');
@@ -296,7 +296,7 @@ if ( isset( $post_new_file ) && current_user_can( $post_type_object->cap->create
<?php if ( $message ) : ?>
<div id="message" class="updated"><p><?php echo $message; ?></p></div>
<?php endif; ?>
<form name="post" action="post.php" method="post" id="post"<?php do_action('post_edit_form_tag'); ?>>
<form name="post" action="post.php" method="post" id="post"<?php do_action('post_edit_form_tag', $post); ?>>
<?php wp_nonce_field($nonce_action); ?>
<input type="hidden" id="user-id" name="user_ID" value="<?php echo (int) $user_ID ?>" />
<input type="hidden" id="hiddenaction" name="action" value="<?php echo esc_attr( $form_action ) ?>" />
@@ -354,7 +354,7 @@ wp_nonce_field( 'samplepermalink', 'samplepermalinknonce', false );
<?php
}
do_action( 'edit_form_after_title' );
do_action( 'edit_form_after_title', $post );
if ( post_type_supports($post_type, 'editor') ) {
?>
@@ -383,16 +383,16 @@ if ( post_type_supports($post_type, 'editor') ) {
</div>
<?php } ?>
<?php do_action( 'edit_form_after_editor' ); ?>
<?php do_action( 'edit_form_after_editor', $post ); ?>
</div><!-- /post-body-content -->
<div id="postbox-container-1" class="postbox-container">
<?php
if ( 'page' == $post_type )
do_action('submitpage_box');
do_action('submitpage_box', $post);
else
do_action('submitpost_box');
do_action('submitpost_box', $post);
do_meta_boxes($post_type, 'side', $post);
@@ -404,9 +404,9 @@ do_meta_boxes($post_type, 'side', $post);
do_meta_boxes(null, 'normal', $post);
if ( 'page' == $post_type )
do_action('edit_page_form');
do_action('edit_page_form', $post);
else
do_action('edit_form_advanced');
do_action('edit_form_advanced', $post);
do_meta_boxes(null, 'advanced', $post);
@@ -414,7 +414,7 @@ do_meta_boxes(null, 'advanced', $post);
</div>
<?php
do_action('dbx_post_sidebar');
do_action('dbx_post_sidebar', $post);
?>
</div><!-- /post-body -->
+1
View File
@@ -183,6 +183,7 @@ class WP_Importer {
$headers = array();
$args = array();
$args['reject_unsafe_urls'] = true;
if ( true === $head )
$args['method'] = 'HEAD';
if ( !empty( $username ) && !empty( $password ) )
+17 -11
View File
@@ -98,7 +98,7 @@ class WP_Upgrader {
break;
default:
if ( ! $wp_filesystem->find_folder($dir) )
return new WP_Error('fs_no_folder', sprintf($this->strings['fs_no_folder'], $dir));
return new WP_Error( 'fs_no_folder', sprintf( $this->strings['fs_no_folder'], esc_html( basename( $dir ) ) ) );
break;
}
}
@@ -1133,7 +1133,7 @@ class WP_Upgrader_Skin {
} elseif ( is_wp_error($errors) && $errors->get_error_code() ) {
foreach ( $errors->get_error_messages() as $message ) {
if ( $errors->get_error_data() )
$this->feedback($message . ' ' . $errors->get_error_data() );
$this->feedback($message . ' ' . esc_html( $errors->get_error_data() ) );
else
$this->feedback($message);
}
@@ -1147,8 +1147,11 @@ class WP_Upgrader_Skin {
if ( strpos($string, '%') !== false ) {
$args = func_get_args();
$args = array_splice($args, 1);
if ( !empty($args) )
if ( $args ) {
$args = array_map( 'strip_tags', $args );
$args = array_map( 'esc_html', $args );
$string = vsprintf($string, $args);
}
}
if ( empty($string) )
return;
@@ -1188,11 +1191,11 @@ class Plugin_Upgrader_Skin extends WP_Upgrader_Skin {
function after() {
$this->plugin = $this->upgrader->plugin_info();
if ( !empty($this->plugin) && !is_wp_error($this->result) && $this->plugin_active ){
echo '<iframe style="border:0;overflow:hidden" width="100%" height="170px" src="' . wp_nonce_url('update.php?action=activate-plugin&networkwide=' . $this->plugin_network_active . '&plugin=' . $this->plugin, 'activate-plugin_' . $this->plugin) .'"></iframe>';
echo '<iframe style="border:0;overflow:hidden" width="100%" height="170px" src="' . wp_nonce_url('update.php?action=activate-plugin&networkwide=' . $this->plugin_network_active . '&plugin=' . urlencode( $this->plugin ), 'activate-plugin_' . $this->plugin) .'"></iframe>';
}
$update_actions = array(
'activate_plugin' => '<a href="' . wp_nonce_url('plugins.php?action=activate&amp;plugin=' . $this->plugin, 'activate-plugin_' . $this->plugin) . '" title="' . esc_attr__('Activate this plugin') . '" target="_parent">' . __('Activate Plugin') . '</a>',
'activate_plugin' => '<a href="' . wp_nonce_url('plugins.php?action=activate&amp;plugin=' . urlencode( $this->plugin ), 'activate-plugin_' . $this->plugin) . '" title="' . esc_attr__('Activate this plugin') . '" target="_parent">' . __('Activate Plugin') . '</a>',
'plugins_page' => '<a href="' . self_admin_url('plugins.php') . '" title="' . esc_attr__('Go to plugins page') . '" target="_parent">' . __('Return to Plugins page') . '</a>'
);
if ( $this->plugin_active || ! $this->result || is_wp_error( $this->result ) || ! current_user_can( 'activate_plugins' ) )
@@ -1244,8 +1247,11 @@ class Bulk_Upgrader_Skin extends WP_Upgrader_Skin {
if ( strpos($string, '%') !== false ) {
$args = func_get_args();
$args = array_splice($args, 1);
if ( !empty($args) )
if ( $args ) {
$args = array_map( 'strip_tags', $args );
$args = array_map( 'esc_html', $args );
$string = vsprintf($string, $args);
}
}
if ( empty($string) )
return;
@@ -1269,7 +1275,7 @@ class Bulk_Upgrader_Skin extends WP_Upgrader_Skin {
if ( is_wp_error($error) ) {
foreach ( $error->get_error_messages() as $emessage ) {
if ( $error->get_error_data() )
$messages[] = $emessage . ' ' . $error->get_error_data();
$messages[] = $emessage . ' ' . esc_html( $error->get_error_data() );
else
$messages[] = $emessage;
}
@@ -1430,12 +1436,12 @@ class Plugin_Installer_Skin extends WP_Upgrader_Skin {
$from = isset($_GET['from']) ? stripslashes($_GET['from']) : 'plugins';
if ( 'import' == $from )
$install_actions['activate_plugin'] = '<a href="' . wp_nonce_url('plugins.php?action=activate&amp;from=import&amp;plugin=' . $plugin_file, 'activate-plugin_' . $plugin_file) . '" title="' . esc_attr__('Activate this plugin') . '" target="_parent">' . __('Activate Plugin &amp; Run Importer') . '</a>';
$install_actions['activate_plugin'] = '<a href="' . wp_nonce_url('plugins.php?action=activate&amp;from=import&amp;plugin=' . urlencode( $plugin_file ), 'activate-plugin_' . $plugin_file) . '" title="' . esc_attr__('Activate this plugin') . '" target="_parent">' . __('Activate Plugin &amp; Run Importer') . '</a>';
else
$install_actions['activate_plugin'] = '<a href="' . wp_nonce_url('plugins.php?action=activate&amp;plugin=' . $plugin_file, 'activate-plugin_' . $plugin_file) . '" title="' . esc_attr__('Activate this plugin') . '" target="_parent">' . __('Activate Plugin') . '</a>';
$install_actions['activate_plugin'] = '<a href="' . wp_nonce_url('plugins.php?action=activate&amp;plugin=' . urlencode( $plugin_file ), 'activate-plugin_' . $plugin_file) . '" title="' . esc_attr__('Activate this plugin') . '" target="_parent">' . __('Activate Plugin') . '</a>';
if ( is_multisite() && current_user_can( 'manage_network_plugins' ) ) {
$install_actions['network_activate'] = '<a href="' . wp_nonce_url('plugins.php?action=activate&amp;networkwide=1&amp;plugin=' . $plugin_file, 'activate-plugin_' . $plugin_file) . '" title="' . esc_attr__('Activate this plugin for all sites in this network') . '" target="_parent">' . __('Network Activate') . '</a>';
$install_actions['network_activate'] = '<a href="' . wp_nonce_url('plugins.php?action=activate&amp;networkwide=1&amp;plugin=' . urlencode( $plugin_file ), 'activate-plugin_' . $plugin_file) . '" title="' . esc_attr__('Activate this plugin for all sites in this network') . '" target="_parent">' . __('Network Activate') . '</a>';
unset( $install_actions['activate_plugin'] );
}
@@ -1670,4 +1676,4 @@ class File_Upload_Upgrader {
return true;
}
}
}
+14 -4
View File
@@ -328,8 +328,14 @@ function wp_handle_upload( &$file, $overrides = false, $time = null ) {
// Move the file to the uploads dir
$new_file = $uploads['path'] . "/$filename";
if ( false === @ move_uploaded_file( $file['tmp_name'], $new_file ) )
return $upload_error_handler( $file, sprintf( __('The uploaded file could not be moved to %s.' ), $uploads['path'] ) );
if ( false === @ move_uploaded_file( $file['tmp_name'], $new_file ) ) {
if ( 0 === strpos( $uploads['basedir'], ABSPATH ) )
$error_path = str_replace( ABSPATH, '', $uploads['basedir'] ) . $uploads['subdir'];
else
$error_path = basename( $uploads['basedir'] ) . $uploads['subdir'];
return $upload_error_handler( $file, sprintf( __('The uploaded file could not be moved to %s.' ), $error_path ) );
}
// Set correct file permissions
$stat = stat( dirname( $new_file ));
@@ -452,7 +458,11 @@ function wp_handle_sideload( &$file, $overrides = false, $time = null ) {
// Move the file to the uploads dir
$new_file = $uploads['path'] . "/$filename";
if ( false === @ rename( $file['tmp_name'], $new_file ) ) {
return $upload_error_handler( $file, sprintf( __('The uploaded file could not be moved to %s.' ), $uploads['path'] ) );
if ( 0 === strpos( $uploads['basedir'], ABSPATH ) )
$error_path = str_replace( ABSPATH, '', $uploads['basedir'] ) . $uploads['subdir'];
else
$error_path = basename( $uploads['basedir'] ) . $uploads['subdir'];
return $upload_error_handler( $file, sprintf( __('The uploaded file could not be moved to %s.' ), $error_path ) );
}
// Set correct file permissions
@@ -487,7 +497,7 @@ function download_url( $url, $timeout = 300 ) {
if ( ! $tmpfname )
return new WP_Error('http_no_file', __('Could not create Temporary file.'));
$response = wp_remote_get( $url, array( 'timeout' => $timeout, 'stream' => true, 'filename' => $tmpfname ) );
$response = wp_remote_get( $url, array( 'timeout' => $timeout, 'stream' => true, 'filename' => $tmpfname, 'reject_unsafe_urls' => true ) );
if ( is_wp_error( $response ) ) {
unlink( $tmpfname );
+1 -3
View File
@@ -2270,9 +2270,7 @@ function multisite_over_quota_message() {
*
* @since 3.5.0
*/
function edit_form_image_editor() {
$post = get_post();
function edit_form_image_editor( $post ) {
$open = isset( $_GET['image-editor'] );
if ( $open )
require_once ABSPATH . 'wp-admin/includes/image-edit.php';
+19 -8
View File
@@ -65,15 +65,24 @@ function _wp_translate_postdata( $update = false, $post_data = null ) {
}
}
if ( ! $update && isset( $post_data['user_ID'] ) && ( $post_data['post_author'] != $post_data['user_ID'] )
if ( isset( $post_data['user_ID'] ) && ( $post_data['post_author'] != $post_data['user_ID'] )
&& ! current_user_can( $ptype->cap->edit_others_posts ) ) {
if ( 'page' == $post_data['post_type'] )
return new WP_Error( 'edit_others_pages', __( 'You are not allowed to create pages as this user.' ) );
else
return new WP_Error( 'edit_others_posts', __( 'You are not allowed to create posts as this user.' ) );
if ( $update ) {
if ( 'page' == $post_data['post_type'] )
return new WP_Error( 'edit_others_pages', __( 'You are not allowed to edit pages as this user.' ) );
else
return new WP_Error( 'edit_others_posts', __( 'You are not allowed to edit posts as this user.' ) );
} else {
if ( 'page' == $post_data['post_type'] )
return new WP_Error( 'edit_others_pages', __( 'You are not allowed to create pages as this user.' ) );
else
return new WP_Error( 'edit_others_posts', __( 'You are not allowed to create posts as this user.' ) );
}
}
if ( ! empty( $post_data['post_status'] ) )
$post_data['post_status'] = sanitize_key( $post_data['post_status'] );
// What to do based on which button they pressed
if ( isset($post_data['saveasdraft']) && '' != $post_data['saveasdraft'] )
$post_data['post_status'] = 'draft';
@@ -92,10 +101,12 @@ function _wp_translate_postdata( $update = false, $post_data = null ) {
$post_id = false;
$previous_status = $post_id ? get_post_field( 'post_status', $post_id ) : false;
$published_statuses = array( 'publish', 'future' );
// Posts 'submitted for approval' present are submitted to $_POST the same as if they were being published.
// Change status from 'publish' to 'pending' if user lacks permissions to publish or to resave published posts.
if ( isset($post_data['post_status']) && ('publish' == $post_data['post_status'] && !current_user_can( $ptype->cap->publish_posts )) )
if ( $previous_status != 'publish' || !current_user_can( 'edit_post', $post_id ) )
if ( isset($post_data['post_status']) && (in_array( $post_data['post_status'], $published_statuses ) && !current_user_can( $ptype->cap->publish_posts )) )
if ( ! in_array( $previous_status, $published_statuses ) || !current_user_can( 'edit_post', $post_id ) )
$post_data['post_status'] = 'pending';
if ( ! isset($post_data['post_status']) )
+1 -1
View File
@@ -536,7 +536,7 @@ function populate_options() {
'can_compress_scripts', 'page_uris', 'update_core', 'update_plugins', 'update_themes', 'doing_cron',
'random_seed', 'rss_excerpt_length', 'secret', 'use_linksupdate', 'default_comment_status_page',
'wporg_popular_tags', 'what_to_show', 'rss_language', 'language', 'enable_xmlrpc', 'enable_app',
'autoembed_urls', 'default_post_edit_rows',
'embed_autourls', 'default_post_edit_rows',
);
foreach ( $unusedoptions as $option )
delete_option($option);
+2
View File
@@ -536,6 +536,8 @@ $_old_files = array(
'wp-includes/js/jquery/ui/jquery.effects.transfer.min.js',
'wp-includes/js/jquery/ui/jquery.effects.fold.min.js',
'wp-admin/options-privacy.php',
// 3.5.2
'wp-includes/js/swfupload/swfupload-all.js',
);
/**
+10
View File
@@ -1277,6 +1277,16 @@ function upgrade_network() {
// 3.5
if ( $wp_current_db_version < 21823 )
update_site_option( 'ms_files_rewriting', '1' );
// 3.5.2
if ( $wp_current_db_version < 22442 ) {
$illegal_names = get_site_option( 'illegal_names' );
if ( is_array( $illegal_names ) && count( $illegal_names ) === 1 ) {
$illegal_name = reset( $illegal_names );
$illegal_names = explode( ' ', $illegal_name );
update_site_option( 'illegal_names', $illegal_names );
}
}
}
// The functions we use to actually do stuff
+8 -8
View File
@@ -57,7 +57,7 @@ if ( isset($_GET['action']) ) {
require_once(ABSPATH . 'wp-admin/admin-header.php');
$nonce = 'upgrade-plugin_' . $plugin;
$url = 'update.php?action=upgrade-plugin&plugin=' . $plugin;
$url = 'update.php?action=upgrade-plugin&plugin=' . urlencode( $plugin );
$upgrader = new Plugin_Upgrader( new Plugin_Upgrader_Skin( compact('title', 'nonce', 'url', 'plugin') ) );
$upgrader->upgrade($plugin);
@@ -70,9 +70,9 @@ if ( isset($_GET['action']) ) {
check_admin_referer('activate-plugin_' . $plugin);
if ( ! isset($_GET['failure']) && ! isset($_GET['success']) ) {
wp_redirect( admin_url('update.php?action=activate-plugin&failure=true&plugin=' . $plugin . '&_wpnonce=' . $_GET['_wpnonce']) );
wp_redirect( admin_url('update.php?action=activate-plugin&failure=true&plugin=' . urlencode( $plugin ) . '&_wpnonce=' . $_GET['_wpnonce']) );
activate_plugin( $plugin, '', ! empty( $_GET['networkwide'] ), true );
wp_redirect( admin_url('update.php?action=activate-plugin&success=true&plugin=' . $plugin . '&_wpnonce=' . $_GET['_wpnonce']) );
wp_redirect( admin_url('update.php?action=activate-plugin&success=true&plugin=' . urlencode( $plugin ) . '&_wpnonce=' . $_GET['_wpnonce']) );
die();
}
iframe_header( __('Plugin Reactivation'), true );
@@ -107,7 +107,7 @@ if ( isset($_GET['action']) ) {
$title = sprintf( __('Installing Plugin: %s'), $api->name . ' ' . $api->version );
$nonce = 'install-plugin_' . $plugin;
$url = 'update.php?action=install-plugin&plugin=' . $plugin;
$url = 'update.php?action=install-plugin&plugin=' . urlencode( $plugin );
if ( isset($_GET['from']) )
$url .= '&from=' . urlencode(stripslashes($_GET['from']));
@@ -132,7 +132,7 @@ if ( isset($_GET['action']) ) {
$submenu_file = 'plugin-install.php';
require_once(ABSPATH . 'wp-admin/admin-header.php');
$title = sprintf( __('Installing Plugin from uploaded file: %s'), basename( $file_upload->filename ) );
$title = sprintf( __('Installing Plugin from uploaded file: %s'), esc_html( basename( $file_upload->filename ) ) );
$nonce = 'plugin-upload';
$url = add_query_arg(array('package' => $file_upload->id), 'update.php?action=upload-plugin');
$type = 'upload'; //Install plugin type, From Web or an Upload.
@@ -160,7 +160,7 @@ if ( isset($_GET['action']) ) {
require_once(ABSPATH . 'wp-admin/admin-header.php');
$nonce = 'upgrade-theme_' . $theme;
$url = 'update.php?action=upgrade-theme&theme=' . $theme;
$url = 'update.php?action=upgrade-theme&theme=' . urlencode( $theme );
$upgrader = new Theme_Upgrader( new Theme_Upgrader_Skin( compact('title', 'nonce', 'url', 'theme') ) );
$upgrader->upgrade($theme);
@@ -213,7 +213,7 @@ if ( isset($_GET['action']) ) {
$title = sprintf( __('Installing Theme: %s'), $api->name . ' ' . $api->version );
$nonce = 'install-theme_' . $theme;
$url = 'update.php?action=install-theme&theme=' . $theme;
$url = 'update.php?action=install-theme&theme=' . urlencode( $theme );
$type = 'web'; //Install theme type, From Web or an Upload.
$upgrader = new Theme_Upgrader( new Theme_Installer_Skin( compact('title', 'url', 'nonce', 'plugin', 'api') ) );
@@ -238,7 +238,7 @@ if ( isset($_GET['action']) ) {
require_once(ABSPATH . 'wp-admin/admin-header.php');
$title = sprintf( __('Installing Theme from uploaded file: %s'), basename( $file_upload->filename ) );
$title = sprintf( __('Installing Theme from uploaded file: %s'), esc_html( basename( $file_upload->filename ) ) );
$nonce = 'theme-upload';
$url = add_query_arg(array('package' => $file_upload->id), 'update.php?action=upload-theme');
$type = 'upload'; //Install plugin type, From Web or an Upload.
Binary file not shown.
+175 -184
View File
@@ -2,7 +2,7 @@
# This file is distributed under the same license as the Administration package.
msgid ""
msgstr ""
"PO-Revision-Date: 2013-01-25 11:15:46+0000\n"
"PO-Revision-Date: 2013-06-23 15:59:28+0000\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
@@ -2407,27 +2407,27 @@ msgstr "Den opplastede filen er større enn upload_max_filesize-regelen i php.in
msgid "The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form."
msgstr "Den opplastede filen er større enn MAX_FILE_SIZE-regelen som ble spesifisert i HTML-skjemaet."
#: wp-admin/includes/file.php:260 wp-admin/includes/file.php:387
#: wp-admin/includes/file.php:260 wp-admin/includes/file.php:393
msgid "The uploaded file was only partially uploaded."
msgstr "Filen ble bare delvis lastet opp."
#: wp-admin/includes/file.php:261 wp-admin/includes/file.php:388
#: wp-admin/includes/file.php:261 wp-admin/includes/file.php:394
msgid "No file was uploaded."
msgstr "Ingen fil ble lastet opp."
#: wp-admin/includes/file.php:263 wp-admin/includes/file.php:390
#: wp-admin/includes/file.php:263 wp-admin/includes/file.php:396
msgid "Missing a temporary folder."
msgstr "Mangler en midlertidig mappe."
#: wp-admin/includes/file.php:264 wp-admin/includes/file.php:391
#: wp-admin/includes/file.php:264 wp-admin/includes/file.php:397
msgid "Failed to write file to disk."
msgstr "Klarte ikke å skrive til disken."
#: wp-admin/includes/file.php:265 wp-admin/includes/file.php:392
#: wp-admin/includes/file.php:265 wp-admin/includes/file.php:398
msgid "File upload stopped by extension."
msgstr "Opplasting av fil ble stoppet av utvidelse."
#: wp-admin/includes/file.php:282 wp-admin/includes/file.php:408
#: wp-admin/includes/file.php:282 wp-admin/includes/file.php:414
msgid "Invalid form submission."
msgstr "Ugyldig sending av skjemaet."
@@ -2443,137 +2443,137 @@ msgstr "Filen er tom. Vennligst last opp noe mer innholdsrikt. Denne feilen kan
msgid "Specified file failed upload test."
msgstr "Filen du angav strøk på opplastingstesten."
#: wp-admin/includes/file.php:312 wp-admin/includes/file.php:433
#: wp-admin/includes/file.php:312 wp-admin/includes/file.php:439
msgid "Sorry, this file type is not permitted for security reasons."
msgstr "Beklager, denne filtypen er ikke tillatt av sikkerhetsgrunner."
#: wp-admin/includes/file.php:332 wp-admin/includes/file.php:455
#: wp-admin/includes/file.php:337 wp-admin/includes/file.php:465
msgid "The uploaded file could not be moved to %s."
msgstr "Filen som ble lastet opp kunne ikke flyttes til %s."
#: wp-admin/includes/file.php:385
#: wp-admin/includes/file.php:391
msgid "The uploaded file exceeds the <code>upload_max_filesize</code> directive in <code>php.ini</code>."
msgstr "Filen du har lastet opp overstiger direktivet <code>upload_max_filesize</code> i <code>php.ini</code>."
#: wp-admin/includes/file.php:386
#: wp-admin/includes/file.php:392
msgid "The uploaded file exceeds the <em>MAX_FILE_SIZE</em> directive that was specified in the HTML form."
msgstr "Filen du har lastet opp overstiger direktivet <code>MAX_FILE_SIZE</code> som er satt i HTML-skjemaet."
#: wp-admin/includes/file.php:416
#: wp-admin/includes/file.php:422
msgid "File is empty. Please upload something more substantial. This error could also be caused by uploads being disabled in your php.ini."
msgstr "Filen er tom. Vennligst last opp noe mer innholdsrikt. Denne feilen kan også komme av at opplasting er deaktivert i php.ini."
#: wp-admin/includes/file.php:420
#: wp-admin/includes/file.php:426
msgid "Specified file does not exist."
msgstr "Spesifisert fil finnes ikke."
#: wp-admin/includes/file.php:484
#: wp-admin/includes/file.php:494
msgid "Invalid URL Provided."
msgstr "Ugyldig URL angitt."
#: wp-admin/includes/file.php:488
#: wp-admin/includes/file.php:498
msgid "Could not create Temporary file."
msgstr "Kunne ikke lage midlertidig fil."
#: wp-admin/includes/file.php:582 wp-admin/includes/file.php:676
#: wp-admin/includes/file.php:592 wp-admin/includes/file.php:686
msgid "Incompatible Archive."
msgstr "Ikke kompatibelt arkiv."
#: wp-admin/includes/file.php:586 wp-admin/includes/file.php:622
#: wp-admin/includes/file.php:596 wp-admin/includes/file.php:632
msgid "Could not retrieve file from archive."
msgstr "Kunne ikke hente fil fra arkivet."
#: wp-admin/includes/file.php:632
#: wp-admin/includes/file.php:642
msgid "Could not extract file from archive."
msgstr "Kunne ikke pakke ut fil fra arkivet."
#: wp-admin/includes/file.php:635 wp-admin/includes/file.php:721
#: wp-admin/includes/file.php:762 wp-admin/includes/update-core.php:638
#: wp-admin/includes/update-core.php:731 wp-admin/includes/update-core.php:823
#: wp-admin/includes/file.php:645 wp-admin/includes/file.php:731
#: wp-admin/includes/file.php:772 wp-admin/includes/update-core.php:640
#: wp-admin/includes/update-core.php:733 wp-admin/includes/update-core.php:825
msgid "Could not copy file."
msgstr "Kunne ikke kopiere fil."
#: wp-admin/includes/file.php:679
#: wp-admin/includes/file.php:689
msgid "Empty archive."
msgstr "Tomt arkiv."
#: wp-admin/includes/file.php:952
#: wp-admin/includes/file.php:962
msgid "<strong>ERROR:</strong> There was an error connecting to the server, Please verify the settings are correct."
msgstr "<strong>FEIL:</strong> Det skjedde en feil i servertilkoblingen, vennligst kontroller innstillingene."
#: wp-admin/includes/file.php:960
#: wp-admin/includes/file.php:970
msgid "FTP"
msgstr "FTP"
#: wp-admin/includes/file.php:962
#: wp-admin/includes/file.php:972
msgid "FTPS (SSL)"
msgstr "FTPS (SSL)"
#: wp-admin/includes/file.php:964
#: wp-admin/includes/file.php:974
msgid "SSH2"
msgstr "SSH2"
#: wp-admin/includes/file.php:985
#: wp-admin/includes/file.php:995
msgid "Connection Information"
msgstr "Tilkoblingsinformasjon"
#: wp-admin/includes/file.php:989
#: wp-admin/includes/file.php:999
msgid "To perform the requested action, WordPress needs to access your web server."
msgstr "For å utføre denne handlingen trenger WordPress å lese filer på din server."
#: wp-admin/includes/file.php:993
#: wp-admin/includes/file.php:1003
msgid "Please enter your FTP or SSH credentials to proceed."
msgstr "Vennligst skriv inn dine FTP- eller SSH-detaljer for å fortsette."
#: wp-admin/includes/file.php:994
#: wp-admin/includes/file.php:1004
msgid "FTP/SSH Username"
msgstr "FTP/SSH brukernavn"
#: wp-admin/includes/file.php:995
#: wp-admin/includes/file.php:1005
msgid "FTP/SSH Password"
msgstr "FTP/SSH passord"
#: wp-admin/includes/file.php:997
#: wp-admin/includes/file.php:1007
msgid "Please enter your FTP credentials to proceed."
msgstr "Vennligst skriv inn innloggingsdetaljene for FTP-tilgang for å fortsette."
#: wp-admin/includes/file.php:998
#: wp-admin/includes/file.php:1008
msgid "FTP Username"
msgstr "FTP brukernavn"
#: wp-admin/includes/file.php:999
#: wp-admin/includes/file.php:1009
msgid "FTP Password"
msgstr "FTP passord"
#: wp-admin/includes/file.php:1003
#: wp-admin/includes/file.php:1013
msgid "If you do not remember your credentials, you should contact your web host."
msgstr "Hvis du ikke husker brukernavn og passord, bør du kontakte din nettjener."
#: wp-admin/includes/file.php:1007
#: wp-admin/includes/file.php:1017
msgid "Hostname"
msgstr "Servernavn"
#: wp-admin/includes/file.php:1023
#: wp-admin/includes/file.php:1033
msgid "Authentication Keys"
msgstr "Autentiseringsnøkler"
#: wp-admin/includes/file.php:1025
#: wp-admin/includes/file.php:1035
msgid "Public Key:"
msgstr "Offentlig nøkkel:"
#: wp-admin/includes/file.php:1026
#: wp-admin/includes/file.php:1036
msgid "Private Key:"
msgstr "Privat nøkkel:"
#: wp-admin/includes/file.php:1029
#: wp-admin/includes/file.php:1039
msgid "Enter the location on the server where the keys are located. If a passphrase is needed, enter that in the password field above."
msgstr "Skriv inn stedet på serveren hvor nøklene er. Bruk passordfeltet over hvis et passord kreves."
#: wp-admin/includes/file.php:1034 wp-admin/includes/file.php:1036
#: wp-admin/includes/file.php:1044 wp-admin/includes/file.php:1046
msgid "Connection Type"
msgstr "Tilkoblingstype"
#: wp-admin/includes/file.php:1055
#: wp-admin/includes/file.php:1065
msgid "Proceed"
msgstr "Fortsett"
@@ -2852,11 +2852,11 @@ msgstr "Vis"
msgid "Hide"
msgstr "Skjul"
#: wp-admin/includes/media.php:1155 wp-admin/includes/media.php:2367
#: wp-admin/includes/media.php:1155 wp-admin/includes/media.php:2365
msgid "File name:"
msgstr "Filnavn:"
#: wp-admin/includes/media.php:1156 wp-admin/includes/media.php:2370
#: wp-admin/includes/media.php:1156 wp-admin/includes/media.php:2368
msgid "File type:"
msgstr "Filtype:"
@@ -2864,7 +2864,7 @@ msgstr "Filtype:"
msgid "Upload date:"
msgstr "Opplastet dato:"
#: wp-admin/includes/media.php:1159 wp-admin/includes/media.php:2380
#: wp-admin/includes/media.php:1159 wp-admin/includes/media.php:2378
msgid "Dimensions:"
msgstr "Dimensjoner:"
@@ -3028,7 +3028,7 @@ msgstr "Skalere bilder for å matche den store størrelsen som er valgt i %1$sbi
msgid "Sorry, you have used all of your storage quota of %s MB."
msgstr "Beklager, du har brukt opp din lagringskvote på %s MB."
#: wp-admin/includes/media.php:2363
#: wp-admin/includes/media.php:2361
msgid "File URL:"
msgstr "Fil-URL:"
@@ -3851,67 +3851,67 @@ msgstr "Denne utvidelsen har ikke en gyldig beskrivelse."
msgid "The \"%s\" options group has been removed. Use another settings group."
msgstr "Gruppen med innstillinger for \"%s\" har blitt fjernet. Bruk en annen gruppe med innstillinger."
#: wp-admin/includes/post.php:33
#: wp-admin/includes/post.php:33 wp-admin/includes/post.php:72
msgid "You are not allowed to edit pages as this user."
msgstr "Du har ikke lov til å redigere sider som denne brukeren."
#: wp-admin/includes/post.php:35
#: wp-admin/includes/post.php:35 wp-admin/includes/post.php:74
msgid "You are not allowed to edit posts as this user."
msgstr "Du har ikke lov til å redigere innlegg som denne brukeren."
#: wp-admin/includes/post.php:287
#: wp-admin/includes/post.php:298
msgid "You are not allowed to edit pages."
msgstr "Du har ikke lov til å redigere sider."
#: wp-admin/includes/post.php:289
#: wp-admin/includes/post.php:300
msgid "You are not allowed to edit posts."
msgstr "Du har ikke lov til å redigere innlegg."
#: wp-admin/includes/post.php:436
#: wp-admin/includes/post.php:447
msgid "Auto Draft"
msgstr "Automatisk kladd"
#: wp-admin/includes/post.php:527
#: wp-admin/includes/post.php:538
msgid "You are not allowed to create pages on this site."
msgstr "Du har ikke lov til å lage sider på dette nettstedet."
#: wp-admin/includes/post.php:529
#: wp-admin/includes/post.php:540
msgid "You are not allowed to create posts or drafts on this site."
msgstr "Du har ikke lov til å lage innlegg eller kladder på dette nettstedet."
#: wp-admin/includes/post.php:1055
#: wp-admin/includes/post.php:1066
msgid "Click to edit this part of the permalink"
msgstr "Klikk for å redigere denne delen av permalenken"
#: wp-admin/includes/post.php:1057
#: wp-admin/includes/post.php:1068
msgid "Temporary permalink. Click to edit this part."
msgstr "Midlertidig permalenke. Klikk for å endre denne delen."
#: wp-admin/includes/post.php:1061 wp-admin/includes/post.php:1089
#: wp-admin/includes/post.php:1072 wp-admin/includes/post.php:1100
msgid "Permalink:"
msgstr "Permalenke:"
#: wp-admin/includes/post.php:1063
#: wp-admin/includes/post.php:1074
msgid "Change Permalinks"
msgstr "Endre permalenker"
#: wp-admin/includes/post.php:1130
#: wp-admin/includes/post.php:1141
msgid "Remove featured image"
msgstr "Slett fremhevet bilde"
#: wp-admin/includes/post.php:1201
#: wp-admin/includes/post.php:1212
msgid "Warning: %s is currently editing this post"
msgstr "Advarsel: %s redigerer dette innlegget nå"
#: wp-admin/includes/post.php:1204
#: wp-admin/includes/post.php:1215
msgid "Warning: %s is currently editing this page"
msgstr "Advarsel: %s redigerer denne siden nå"
#: wp-admin/includes/post.php:1207
#: wp-admin/includes/post.php:1218
msgid "Warning: %s is currently editing this."
msgstr "Advarsel: %s redigerer dette nå"
#: wp-admin/includes/post.php:1268
#: wp-admin/includes/post.php:1279
msgid "Preview not available. Please save as a draft first."
msgstr "Forhåndsvisning ikke tilgjengelig. Vennligst lagre som kladd først."
@@ -4180,10 +4180,6 @@ msgctxt "post state"
msgid "Pending"
msgstr "Ventende"
#: wp-admin/includes/template.php:1609 wp-admin/options.php:225
msgid "Save Changes"
msgstr "Lagre endringene"
#: wp-admin/includes/template.php:1764
msgid "New Feature: Toolbar"
msgstr "Ny funksjon: Verktøylinje"
@@ -4434,39 +4430,39 @@ msgstr "Fotoblogging"
msgid "Seasonal"
msgstr "Sesong"
#: wp-admin/includes/update-core.php:619
#: wp-admin/includes/update-core.php:621
msgid "Verifying the unpacked files&#8230;"
msgstr "Verifiserer utpakkede filer&#8230;"
#: wp-admin/includes/update-core.php:630
#: wp-admin/includes/update-core.php:632
msgid "The update could not be unpacked"
msgstr "Oppdateringen kunne ikke pakkes ut"
#: wp-admin/includes/update-core.php:659
#: wp-admin/includes/update-core.php:661
msgid "The update cannot be installed because WordPress %1$s requires PHP version %2$s or higher and MySQL version %3$s or higher. You are running PHP version %4$s and MySQL version %5$s."
msgstr "Oppdateringen kunne ikke installeres fordi WordPress %1$s krever PHP versjon %2$s eller høyere og MySQL versjon %3$s eller høyere. Du bruker PHP versjon %4$s og MySQL verson %5$s."
#: wp-admin/includes/update-core.php:661
#: wp-admin/includes/update-core.php:663
msgid "The update cannot be installed because WordPress %1$s requires PHP version %2$s or higher. You are running version %3$s."
msgstr "Oppdateringen kunne ikke installeres fordi WordPress %1$s krever PHP versjon %2$s eller høyere. Du bruker versjon %3$s."
#: wp-admin/includes/update-core.php:663
#: wp-admin/includes/update-core.php:665
msgid "The update cannot be installed because WordPress %1$s requires MySQL version %2$s or higher. You are running version %3$s."
msgstr "Oppdateringen kunne ikke installeres fordi WordPress %1$s krever MySQL versjon %2$s eller høyere. Du bruker versjon %3$s."
#: wp-admin/includes/update-core.php:761
#: wp-admin/includes/update-core.php:763
msgid "Upgrading database&#8230;"
msgstr "Oppgraderer database&#8230;"
#: wp-admin/includes/update-core.php:863 wp-admin/update-core.php:356
#: wp-admin/includes/update-core.php:865 wp-admin/update-core.php:356
msgid "WordPress updated successfully"
msgstr "Oppdateringen av WordPress var vellykket"
#: wp-admin/includes/update-core.php:866 wp-admin/update-core.php:357
#: wp-admin/includes/update-core.php:868 wp-admin/update-core.php:357
msgid "Welcome to WordPress %1$s. You will be redirected to the About WordPress screen. If not, click <a href=\"%2$s\">here</a>."
msgstr "Velkommen til WordPress %1$s. Du vil bli omdirigert til Om WordPress-skjermen. Hvis ikke, klikk <a href=\"%2$s\">her</a>."
#: wp-admin/includes/update-core.php:867 wp-admin/update-core.php:358
#: wp-admin/includes/update-core.php:869 wp-admin/update-core.php:358
msgid "Welcome to WordPress %1$s. <a href=\"%2$s\">Learn more</a>."
msgstr "Velkommen til WordPress %1$s. <a href=\"%2$s\">Lær mer</a>."
@@ -5241,11 +5237,6 @@ msgstr "Frem til WordPress versjon 3.0, måtte det som nå heter Nettstedsnettve
msgid "<a href=\"http://codex.wordpress.org/Dashboard_My_Sites_Screen\" target=\"_blank\">Documentation on My Sites</a>"
msgstr "<a href=\"http://codex.wordpress.org/Dashboard_My_Sites_Screen\" target=\"_blank\">Dokumentasjon om Mine nettsteder</a>"
#: wp-admin/my-sites.php:55 wp-admin/options-head.php:16
#: wp-admin/options.php:164
msgid "Settings saved."
msgstr "Innstillinger lagret."
#: wp-admin/my-sites.php:64
msgid "You must be a member of at least one site to use this page."
msgstr "Du må være medlem på minst ett nettsted for å bruke denne siden."
@@ -5752,7 +5743,7 @@ msgstr[1] "Innslipp <span class=\"count\">(%s)</span>"
#: wp-admin/includes/class-wp-plugins-list-table.php:240
#: wp-admin/includes/class-wp-plugins-list-table.php:345
#: wp-admin/includes/class-wp-upgrader.php:1438
#: wp-admin/includes/class-wp-upgrader.php:1444
msgid "Network Activate"
msgstr "Aktiver nettverk"
@@ -5787,7 +5778,7 @@ msgid "Deactivate this plugin"
msgstr "Deaktiver denne utvidelsen"
#: wp-admin/includes/class-wp-plugins-list-table.php:345
#: wp-admin/includes/class-wp-upgrader.php:1438
#: wp-admin/includes/class-wp-upgrader.php:1444
msgid "Activate this plugin for all sites in this network"
msgstr "Aktiver utvidelsen for alle nettstedene i nettverket"
@@ -5797,9 +5788,9 @@ msgid "Delete this plugin"
msgstr "Slett denne utvidelsen"
#: wp-admin/includes/class-wp-plugins-list-table.php:353
#: wp-admin/includes/class-wp-upgrader.php:1195
#: wp-admin/includes/class-wp-upgrader.php:1433
#: wp-admin/includes/class-wp-upgrader.php:1435
#: wp-admin/includes/class-wp-upgrader.php:1198
#: wp-admin/includes/class-wp-upgrader.php:1439
#: wp-admin/includes/class-wp-upgrader.php:1441
msgid "Activate this plugin"
msgstr "Aktiver denne utvidelsen"
@@ -5860,10 +5851,10 @@ msgstr "Slett dette permanent"
#: wp-admin/includes/class-wp-posts-list-table.php:559
#: wp-admin/includes/class-wp-theme-install-list-table.php:188
#: wp-admin/includes/class-wp-themes-list-table.php:140
#: wp-admin/includes/class-wp-upgrader.php:1515
#: wp-admin/includes/class-wp-upgrader.php:1516
#: wp-admin/includes/class-wp-upgrader.php:1582
#: wp-admin/includes/class-wp-upgrader.php:1583
#: wp-admin/includes/class-wp-upgrader.php:1521
#: wp-admin/includes/class-wp-upgrader.php:1522
#: wp-admin/includes/class-wp-upgrader.php:1588
#: wp-admin/includes/class-wp-upgrader.php:1589
msgid "Preview &#8220;%s&#8221;"
msgstr "Forhåndsvis &laquo;%s&raquo;"
@@ -6025,14 +6016,14 @@ msgid "Only the current theme is available to you. Contact the %s administrator
msgstr "Kun det aktive temaet er tilgjengelig for deg nå. Kontakt administratoren på %s for informasjon om hvordan du får tilgang til flere temaer."
#: wp-admin/includes/class-wp-themes-list-table.php:137
#: wp-admin/includes/class-wp-upgrader.php:1517
#: wp-admin/includes/class-wp-upgrader.php:1584
#: wp-admin/includes/class-wp-upgrader.php:1523
#: wp-admin/includes/class-wp-upgrader.php:1590
msgid "Activate &#8220;%s&#8221;"
msgstr "Aktiver &laquo;%s&raquo;"
#: wp-admin/includes/class-wp-themes-list-table.php:144
#: wp-admin/includes/class-wp-upgrader.php:1516
#: wp-admin/includes/class-wp-upgrader.php:1583
#: wp-admin/includes/class-wp-upgrader.php:1522
#: wp-admin/includes/class-wp-upgrader.php:1589
msgid "Live Preview"
msgstr "Live forhåndsvisning"
@@ -6060,7 +6051,7 @@ msgstr "http://codex.wordpress.org/Child_Themes"
msgid "Invalid Data provided."
msgstr "Ugyldig data angitt"
#: wp-admin/includes/class-wp-upgrader.php:42 wp-admin/includes/file.php:522
#: wp-admin/includes/class-wp-upgrader.php:42 wp-admin/includes/file.php:532
#: wp-admin/includes/plugin.php:710 wp-admin/includes/theme.php:53
msgid "Could not access filesystem."
msgstr "Kunne ikke lese filsystemet."
@@ -6095,7 +6086,7 @@ msgid "Download failed."
msgstr "Nedlasting feilet."
#: wp-admin/includes/class-wp-upgrader.php:52
#: wp-admin/includes/update-core.php:665
#: wp-admin/includes/update-core.php:667
msgid "Installing the latest version&#8230;"
msgstr "Installerer den nyeste versjonen&#8230;"
@@ -6103,9 +6094,9 @@ msgstr "Installerer den nyeste versjonen&#8230;"
msgid "Destination folder already exists."
msgstr "Målmappen finnes allerede."
#: wp-admin/includes/class-wp-upgrader.php:54 wp-admin/includes/file.php:616
#: wp-admin/includes/file.php:708 wp-admin/includes/file.php:767
#: wp-admin/includes/update-core.php:828
#: wp-admin/includes/class-wp-upgrader.php:54 wp-admin/includes/file.php:626
#: wp-admin/includes/file.php:718 wp-admin/includes/file.php:777
#: wp-admin/includes/update-core.php:830
msgid "Could not create directory."
msgstr "Kunne ikke lage mappe."
@@ -6274,120 +6265,120 @@ msgstr "Kunne ikke kopiere filer."
msgid "Could not copy files. You may have run out of disk space."
msgstr "Kunne ikke kopiere filer. Du kan ha gått tom for lagringsplass."
#: wp-admin/includes/class-wp-upgrader.php:1177 wp-admin/update.php:54
#: wp-admin/includes/class-wp-upgrader.php:1180 wp-admin/update.php:54
msgid "Update Plugin"
msgstr "Oppdater utvidelse"
#: wp-admin/includes/class-wp-upgrader.php:1195
#: wp-admin/includes/class-wp-upgrader.php:1435
#: wp-admin/includes/class-wp-upgrader.php:1198
#: wp-admin/includes/class-wp-upgrader.php:1441
msgid "Activate Plugin"
msgstr "Aktiver utvidelse"
#: wp-admin/includes/class-wp-upgrader.php:1196
#: wp-admin/includes/class-wp-upgrader.php:1349
#: wp-admin/includes/class-wp-upgrader.php:1199
#: wp-admin/includes/class-wp-upgrader.php:1355
msgid "Go to plugins page"
msgstr "Gå til siden med utvidelser"
#: wp-admin/includes/class-wp-upgrader.php:1196
#: wp-admin/includes/class-wp-upgrader.php:1349
#: wp-admin/includes/class-wp-upgrader.php:1447
#: wp-admin/includes/class-wp-upgrader.php:1199
#: wp-admin/includes/class-wp-upgrader.php:1355
#: wp-admin/includes/class-wp-upgrader.php:1453
msgid "Return to Plugins page"
msgstr "Gå tilbake til siden med utvidelser"
#: wp-admin/includes/class-wp-upgrader.php:1233
#: wp-admin/includes/class-wp-upgrader.php:1236
msgid "The update process is starting. This process may take a while on some hosts, so please be patient."
msgstr "Oppdateringen starter. Denne prosessen kan ta en stund på noen verter, så vær tålmodig."
#: wp-admin/includes/class-wp-upgrader.php:1234
#: wp-admin/includes/class-wp-upgrader.php:1237
msgid "An error occurred while updating %1$s: <strong>%2$s</strong>."
msgstr "En feil skjedde under oppdateringen av %1$s: <strong>%2$s</strong>."
#: wp-admin/includes/class-wp-upgrader.php:1235
#: wp-admin/includes/class-wp-upgrader.php:1238
msgid "The update of %1$s failed."
msgstr "Oppdatering av %1$s feilet."
#: wp-admin/includes/class-wp-upgrader.php:1236
#: wp-admin/includes/class-wp-upgrader.php:1239
msgid "%1$s updated successfully."
msgstr "Oppdateringen av %1$s var vellykket."
#: wp-admin/includes/class-wp-upgrader.php:1236
#: wp-admin/includes/class-wp-upgrader.php:1239
msgid "Show Details"
msgstr "Vis detaljer"
#: wp-admin/includes/class-wp-upgrader.php:1236
#: wp-admin/includes/class-wp-upgrader.php:1239
msgid "Hide Details"
msgstr "Skjul detaljer"
#: wp-admin/includes/class-wp-upgrader.php:1237
#: wp-admin/includes/class-wp-upgrader.php:1240
msgid "All updates have been completed."
msgstr "Alle oppgraderinger har blitt fullført."
#: wp-admin/includes/class-wp-upgrader.php:1336
#: wp-admin/includes/class-wp-upgrader.php:1342
msgid "Updating Plugin %1$s (%2$d/%3$d)"
msgstr "Oppdaterer utvidelse %1$s (%2$d/%3$d)"
#: wp-admin/includes/class-wp-upgrader.php:1350
#: wp-admin/includes/class-wp-upgrader.php:1385
#: wp-admin/includes/class-wp-upgrader.php:1356
#: wp-admin/includes/class-wp-upgrader.php:1391
msgid "Go to WordPress Updates page"
msgstr "Gå til siden for WordPress-oppdateringer"
#: wp-admin/includes/class-wp-upgrader.php:1350
#: wp-admin/includes/class-wp-upgrader.php:1385
#: wp-admin/includes/class-wp-upgrader.php:1356
#: wp-admin/includes/class-wp-upgrader.php:1391
msgid "Return to WordPress Updates"
msgstr "Gå tilbake til WordPress-oppdateringer"
#: wp-admin/includes/class-wp-upgrader.php:1370
#: wp-admin/includes/class-wp-upgrader.php:1376
msgid "Updating Theme %1$s (%2$d/%3$d)"
msgstr "Oppdaterer tema %1$s (%2$d/%3$d)"
#: wp-admin/includes/class-wp-upgrader.php:1384
#: wp-admin/includes/class-wp-upgrader.php:1390
msgid "Go to themes page"
msgstr "Gå til temasiden"
#: wp-admin/includes/class-wp-upgrader.php:1384
#: wp-admin/includes/class-wp-upgrader.php:1525
#: wp-admin/includes/class-wp-upgrader.php:1591
#: wp-admin/includes/class-wp-upgrader.php:1390
#: wp-admin/includes/class-wp-upgrader.php:1531
#: wp-admin/includes/class-wp-upgrader.php:1597
msgid "Return to Themes page"
msgstr "Gå tilbake til temasiden"
#: wp-admin/includes/class-wp-upgrader.php:1421
#: wp-admin/includes/class-wp-upgrader.php:1427
msgid "Successfully installed the plugin <strong>%s %s</strong>."
msgstr "Installerte utvidelsen <strong>%s %s</strong>."
#: wp-admin/includes/class-wp-upgrader.php:1433
#: wp-admin/includes/class-wp-upgrader.php:1439
msgid "Activate Plugin &amp; Run Importer"
msgstr "Aktiver utvidelse &amp; kjør import"
#: wp-admin/includes/class-wp-upgrader.php:1443
#: wp-admin/includes/class-wp-upgrader.php:1449
msgid "Return to Importers"
msgstr "Gå tilbake til importererne"
#: wp-admin/includes/class-wp-upgrader.php:1445
#: wp-admin/includes/class-wp-upgrader.php:1451
msgid "Return to Plugin Installer"
msgstr "Gå tilbake til installering av utvidelser"
#: wp-admin/includes/class-wp-upgrader.php:1520
#: wp-admin/includes/class-wp-upgrader.php:1526
msgid "Enable this theme for all sites in this network"
msgstr "Gjør dette temaet tilgjengelig for alle nettsteder i nettverket"
#: wp-admin/includes/class-wp-upgrader.php:1523
#: wp-admin/includes/class-wp-upgrader.php:1529
msgid "Return to Theme Installer"
msgstr "Gå tilbake til temainstallasjon"
#: wp-admin/includes/class-wp-upgrader.php:1525
#: wp-admin/includes/class-wp-upgrader.php:1531
msgid "Themes page"
msgstr "Tema side"
#: wp-admin/includes/class-wp-upgrader.php:1549 wp-admin/update.php:157
#: wp-admin/includes/class-wp-upgrader.php:1555 wp-admin/update.php:157
msgid "Update Theme"
msgstr "Oppdater tema"
#: wp-admin/includes/class-wp-upgrader.php:1580 wp-admin/themes.php:124
#: wp-admin/includes/class-wp-upgrader.php:1586 wp-admin/themes.php:124
msgid "Customize &#8220;%s&#8221;"
msgstr "Tilpass temaet «%s»"
#: wp-admin/includes/class-wp-upgrader.php:1616
#: wp-admin/includes/class-wp-upgrader.php:1650
#: wp-admin/includes/class-wp-upgrader.php:1622
#: wp-admin/includes/class-wp-upgrader.php:1656
msgid "Please select a file"
msgstr "Vennligst velg en fil"
@@ -6642,7 +6633,7 @@ msgid "This dashboard widget queries <a href=\"http://blogsearch.google.com/\">G
msgstr "Denne kontrollpanelwidgeten spør <a href=\"http://blogsearch.google.com/\">Google blogg søk</a> så andre blogger som lenker til deg, vil vises her. Ingen innkommende lenker er funnet ennå. Det er helt i orden, intet hastverk."
#: wp-admin/includes/dashboard.php:820 wp-admin/includes/dashboard.php:822
#: wp-admin/includes/post.php:1197
#: wp-admin/includes/post.php:1208
msgid "Somebody"
msgstr "Noen"
@@ -7213,7 +7204,7 @@ msgstr "Aktiver"
#: wp-admin/includes/class-wp-ms-themes-list-table.php:233
#: wp-admin/includes/class-wp-ms-themes-list-table.php:276
#: wp-admin/includes/class-wp-upgrader.php:1520
#: wp-admin/includes/class-wp-upgrader.php:1526
msgid "Network Enable"
msgstr "Gjør tilgjengelig i nettverk"
@@ -7440,193 +7431,193 @@ msgstr "Takk til"
msgid "Freedoms"
msgstr "Friheter"
#: wp-admin/about.php:45 wp-admin/includes/template.php:1830
#: wp-admin/about.php:49 wp-admin/includes/template.php:1830
msgid "New Media Manager"
msgstr "Ny mediehåndtering"
#: wp-admin/about.php:51
#: wp-admin/about.php:55
msgid "Beautiful Interface"
msgstr "Nydelig grensesnitt"
#: wp-admin/about.php:52
#: wp-admin/about.php:56
msgid "Adding media has been streamlined with an all-new experience, making it a breeze to upload files and place them into your posts."
msgstr "Å legge til media har blitt strømlinjeformet med en helt ny opplevelse som gjør det enkelt å laste opp filer og plassere dem inn i innleggene."
#: wp-admin/about.php:55
#: wp-admin/about.php:59
msgid "Picturesque Galleries"
msgstr "Enklere gallerier"
#: wp-admin/about.php:56
#: wp-admin/about.php:60
msgid "Creating image galleries is faster with drag and drop reordering, inline caption editing, and simplified controls for layout."
msgstr "Å lage gallerier går raskere med dra-og-slipp for å endre rekkefølge, enkel redigering av bildetekster og enklere kontroller for utseende."
#: wp-admin/about.php:62
#: wp-admin/about.php:66
msgid "New Default Theme"
msgstr "Nytt standardtema"
#: wp-admin/about.php:66
#: wp-admin/about.php:70
msgid "Introducing Twenty Twelve"
msgstr "Vi introduserer Twenty Twelve"
#: wp-admin/about.php:67
#: wp-admin/about.php:71
msgid "The newest default theme for WordPress is simple, flexible, and elegant."
msgstr "Det nyeste standardtemaet for WordPress er enkelt, fleksibelt og elegant."
#: wp-admin/about.php:68
#: wp-admin/about.php:72
msgid "What makes it really shine are the design details, like the gorgeous Open Sans typeface and a fully responsive design that looks great on any device."
msgstr "Det som virkelig gjør dette temaet bra er designdetaljene, som Open Sans-fonten, og et helt responsivt design som ser bra ut både på mobil, nettbrett og datamaskin."
#: wp-admin/about.php:69
#: wp-admin/about.php:73
msgid "Naturally, Twenty Twelve supports all the theme features you’ve come to know and love, but it is also designed to be as great for a website as it is for a blog."
msgstr "Naturligvis støtter Twenty Twelve alle temafunksjonene som du har blitt kjent med, men det er også designet for å fungere like bra for nettsteder som for blogger."
#: wp-admin/about.php:74
#: wp-admin/about.php:78
msgid "Retina Ready"
msgstr "Retina-klart"
#: wp-admin/about.php:78
#: wp-admin/about.php:82
msgid "So Sharp You Can&#8217;t See the Pixels"
msgstr "Så skarpt at du ikke kan se pikslene"
#: wp-admin/about.php:79
#: wp-admin/about.php:83
msgid "The WordPress dashboard now looks beautiful on high-resolution screens like those found on the iPad, Kindle Fire HD, Nexus 10, and MacBook Pro with Retina Display. Icons and other visual elements are crystal clear and full of detail."
msgstr "Kontrollpanelet til WordPress ser nydelig ut på skjermer med høy oppløsning, som de du finner på iPad, Kindle Fire HD, Nexus 10 og MacBook Pro med Retina Display. Ikoner og andre visuelle elementer er krystallklare og fulle av detaljer."
#: wp-admin/about.php:84
#: wp-admin/about.php:88
msgid "Smoother Experience"
msgstr "Bedre flyt"
#: wp-admin/about.php:88
#: wp-admin/about.php:92
msgid "Better Accessibility"
msgstr "Bedre tilgjengelighet"
#: wp-admin/about.php:89
#: wp-admin/about.php:93
msgid "WordPress supports more usage modes than ever before. Screenreaders, touch devices, and mouseless workflows all have improved ease of use and accessibility."
msgstr "WordPress støtter flere bruksmåter enn noensinne. Skjermlesere, touch-enheter og musløs arbeidsflyt har forbedret tilgjengelighet og gjort det enklere."
#: wp-admin/about.php:91
#: wp-admin/about.php:95
msgid "More Polish"
msgstr "Bedre polert"
#: wp-admin/about.php:92
#: wp-admin/about.php:96
msgid "A number of screens and controls have been refined. For example, a new color picker makes it easier for you to choose that perfect shade of blue."
msgstr "En rekke skjermer og kontroller har blitt forbedret. For eksempel, en ny fargevelger gjør det enklere for deg å velge den perfekte blånyansen."
#: wp-admin/about.php:97
#: wp-admin/about.php:101
msgid "Under the Hood"
msgstr "Under panseret"
#: wp-admin/about.php:101
#: wp-admin/about.php:105
msgid "Meta Query Additions"
msgstr "Meta Query-tillegg"
#: wp-admin/about.php:102
#: wp-admin/about.php:106
msgid "The <code>WP_Comment_Query</code> and <code>WP_User_Query</code> classes now support meta queries just like <code>WP_Query.</code> Meta queries now support querying for objects without a particular meta key."
msgstr "<code>WP_Comment_Query</code>- og <code>WP_User_Query</code>-klassene støtter nå metaspørringer akkurat som <code>WP_Query</code>. Metaspørringer støtter å søke etter objekter uten en bestemt meta-nøkkel."
#: wp-admin/about.php:105
#: wp-admin/about.php:109
msgid "Post Objects"
msgstr "Post Objects"
#: wp-admin/about.php:106
#: wp-admin/about.php:110
msgid "Post objects are now instances of a <code>WP_Post</code> class, which improves performance by loading selected properties on demand."
msgstr "Post objects er nå instanser av <code>WP_Post</code>-klassen, som øker ytelsen ved å laste inn valgte attributter når det trengs."
#: wp-admin/about.php:109
#: wp-admin/about.php:113
msgid "Image Editing API"
msgstr "Bilderedigerings-API"
#: wp-admin/about.php:110
#: wp-admin/about.php:114
msgid "The <code>WP_Image_Editor</code> class abstracts image editing functionality such as cropping and scaling, and uses ImageMagick when available."
msgstr "<code>WP_Image_Editor</code>-klassen kan redigere bilder, for eksempel ved hjelp av utsnitt og skalering, og bruker ImageMagick når det er tilgjengelig."
#: wp-admin/about.php:116
#: wp-admin/about.php:120
msgid "Multisite Improvements"
msgstr "Forbedringer for nettstedsnettverk"
#: wp-admin/about.php:117
#: wp-admin/about.php:121
msgid "<code>switch_to_blog()</code> is now significantly faster and more reliable."
msgstr "<code>switch_to_blog()</code> er nå betydelig raskere og mer stabil."
#: wp-admin/about.php:120
#: wp-admin/about.php:124
msgid "XML-RPC API"
msgstr "XML-RPC-API"
#: wp-admin/about.php:121
#: wp-admin/about.php:125
msgid "The <a href=\"%s\">WordPress API</a> is now always enabled, and supports fetching users, editing profiles, managing post revisions, and searching posts."
msgstr "<a href=\"%s\">WordPress API</a> er nå alltid aktivert, og støtter å hente brukere, redigering av profiler, hndtering av innleggsrevisjoner og søk etter innlegg."
#: wp-admin/about.php:121
#: wp-admin/about.php:125
msgid "http://codex.wordpress.org/XML-RPC_WordPress_API"
msgstr "http://codex.wordpress.org/XML-RPC_WordPress_API"
#: wp-admin/about.php:124 wp-admin/credits.php:160
#: wp-admin/about.php:128 wp-admin/credits.php:160
msgid "External Libraries"
msgstr "Eksterne programbibliotek"
#: wp-admin/about.php:125
#: wp-admin/about.php:129
msgid "WordPress now includes the <a href=\"%1$s\">Underscore</a> and <a href=\"%2$s\">Backbone</a> JavaScript libraries. TinyMCE, jQuery, jQuery UI, and SimplePie have all been updated to the latest versions."
msgstr "WordPress inkluderer nå JavaScript-bibliotekene <a href=\"%1$s\">Underscore</a> og <a href=\"%2$s\">Backbone</a> . TinyMCE, jQuery, jQuery UI og SimplePie har alle blitt oppdatert til siste versjon."
#: wp-admin/about.php:133
#: wp-admin/about.php:137
msgid "Return to Updates"
msgstr "Tilbake til oppdateringer"
#: wp-admin/about.php:133
#: wp-admin/about.php:137
msgid "Return to Dashboard &rarr; Updates"
msgstr "Tilbake til Kontrollpanel &rarr; Oppdateringer"
#: wp-admin/about.php:137
#: wp-admin/about.php:141
msgid "Go to Dashboard &rarr; Home"
msgstr "Gå til Kontrollpanel &rarr; Hjem"
#: wp-admin/about.php:137
#: wp-admin/about.php:141
msgid "Go to Dashboard"
msgstr "Gå til kontrollpanel"
#: wp-admin/about.php:148
#: wp-admin/about.php:152
msgid "Maintenance Release"
msgid_plural "Maintenance Releases"
msgstr[0] "Vedlikeholdsoppdatering"
msgstr[1] "Vedlikeholdsoppdateringer"
#: wp-admin/about.php:149
#: wp-admin/about.php:153
msgid "Security Release"
msgid_plural "Security Releases"
msgstr[0] "Sikkerhetsoppdatering"
msgstr[1] "Sikkerhetsoppdateringer"
#: wp-admin/about.php:37 wp-admin/about.php:150
#: wp-admin/about.php:37 wp-admin/about.php:154
msgid "Maintenance and Security Release"
msgid_plural "Maintenance and Security Releases"
msgstr[0] "Vedlikeholds- og sikkerhetsoppdatering"
msgstr[1] "Vedlikeholds- og sikkerhetsoppdateringer"
#: wp-admin/about.php:153
#: wp-admin/about.php:157
msgid "<strong>Version %1$s</strong> addressed a security issue."
msgid_plural "<strong>Version %1$s</strong> addressed some security issues."
msgstr[0] "<strong>Versjon %1$s</strong> tettet et sikkerhetshull"
msgstr[1] "<strong>Versjon %1$s</strong> tettet noen sikkerhetshull."
#: wp-admin/about.php:157
#: wp-admin/about.php:161
msgid "<strong>Version %1$s</strong> addressed %2$s bug."
msgid_plural "<strong>Version %1$s</strong> addressed %2$s bugs."
msgstr[0] "<strong>Versjon %1$s</strong> rettet %2$s programfeil."
msgstr[1] "<strong>Versjon %1$s</strong> rettet %2$s programfeil."
#: wp-admin/about.php:161
#: wp-admin/about.php:165
msgid "<strong>Version %1$s</strong> addressed a security issue and fixed %2$s bug."
msgid_plural "<strong>Version %1$s</strong> addressed a security issue and fixed %2$s bugs."
msgstr[0] "<strong>Versjon %1$s</strong> tettet et sikkerhetshull og rettet %2$s programfeil."
msgstr[1] "<strong>Versjon %1$s</strong> tettet et sikkerhetshull og rettet %2$s programfeil."
#: wp-admin/about.php:38 wp-admin/about.php:165
#: wp-admin/about.php:38 wp-admin/about.php:42 wp-admin/about.php:169
msgid "<strong>Version %1$s</strong> addressed some security issues and fixed %2$s bug."
msgid_plural "<strong>Version %1$s</strong> addressed some security issues and fixed %2$s bugs."
msgstr[0] "<strong>Versjon %1$s</strong> tettet noen sikkerhetshull og rettet %2$s programfeil."
msgstr[1] "<strong>Versjon %1$s</strong> tettet noen sikkerhetshull og rettet %2$s programfeil."
#: wp-admin/about.php:40 wp-admin/about.php:168
#: wp-admin/about.php:40 wp-admin/about.php:44 wp-admin/about.php:172
msgid "For more information, see <a href=\"%s\">the release notes</a>."
msgstr "For mer informasjon, se <a href=\"%s\">versjonsmerknadene</a>."
@@ -9234,14 +9225,14 @@ msgid "%s is currently editing this article. If you update it, you will overwrit
msgstr "%s redigerer denne artikkelen nå. Hvis du oppdaterer den, vil du overskrive endringene."
#: wp-admin/includes/ajax-actions.php:1071
#: wp-admin/includes/ajax-actions.php:1314 wp-admin/includes/post.php:166
#: wp-admin/includes/post.php:1284
#: wp-admin/includes/ajax-actions.php:1314 wp-admin/includes/post.php:177
#: wp-admin/includes/post.php:1295
msgid "You are not allowed to edit this page."
msgstr "Du har ikke lov til å redigere denne siden."
#: wp-admin/includes/ajax-actions.php:1074
#: wp-admin/includes/ajax-actions.php:1317 wp-admin/includes/post.php:168
#: wp-admin/includes/post.php:1287 wp-admin/press-this.php:35
#: wp-admin/includes/ajax-actions.php:1317 wp-admin/includes/post.php:179
#: wp-admin/includes/post.php:1298 wp-admin/press-this.php:35
#: wp-admin/upload.php:62
msgid "You are not allowed to edit this post."
msgstr "Du har ikke lov til å redigere dette innlegget."
Binary file not shown.
+5 -1
View File
@@ -2,7 +2,7 @@
# This file is distributed under the same license as the Network Admin package.
msgid ""
msgstr ""
"PO-Revision-Date: 2013-01-25 11:15:46+0000\n"
"PO-Revision-Date: 2013-06-23 15:59:29+0000\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
@@ -10,6 +10,10 @@ msgstr ""
"X-Generator: GlotPress/0.1\n"
"Project-Id-Version: Network Admin\n"
#: wp-admin/network/settings.php:78
msgid "Options saved."
msgstr "Innstillinger lagret."
#: wp-admin/network/settings.php:146
msgid "Banned Names"
msgstr "Forbudte navn"
Binary file not shown.
@@ -2,7 +2,7 @@
# This file is distributed under the same license as the Continents & Cities package.
msgid ""
msgstr ""
"PO-Revision-Date: 2013-01-25 11:15:44+0000\n"
"PO-Revision-Date: 2013-06-23 15:59:27+0000\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
Binary file not shown.
File diff suppressed because it is too large. Load diff
Binary file not shown.
@@ -2,7 +2,7 @@
# This file is distributed under the same license as the Twenty Eleven package.
msgid ""
msgstr ""
"PO-Revision-Date: 2013-01-25 11:15:47+0000\n"
"PO-Revision-Date: 2013-06-23 15:59:29+0000\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
Binary file not shown.
@@ -2,7 +2,7 @@
# This file is distributed under the same license as the Twenty Ten package.
msgid ""
msgstr ""
"PO-Revision-Date: 2013-01-25 11:15:46+0000\n"
"PO-Revision-Date: 2013-06-23 15:59:29+0000\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
Binary file not shown.
@@ -2,7 +2,7 @@
# This file is distributed under the same license as the Twenty Twelve package.
msgid ""
msgstr ""
"PO-Revision-Date: 2013-01-25 11:15:47+0000\n"
"PO-Revision-Date: 2013-06-23 15:59:30+0000\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
@@ -230,7 +230,7 @@ msgstr "Vis alle innlegg av %s"
#: functions.php:352
msgid "This entry was posted in %1$s and tagged %2$s on %3$s<span class=\"by-author\"> by %4$s</span>."
msgstr "Dette innlegget ble skrevet i %1$s og market %2$s, %3$s<span class=\"by-author\"> av %4$s</span>."
msgstr "Dette innlegget ble skrevet i %1$s og merket %2$s, %3$s<span class=\"by-author\"> av %4$s</span>."
#: functions.php:354
msgid "This entry was posted in %1$s on %3$s<span class=\"by-author\"> by %4$s</span>."
+5
View File
@@ -3,4 +3,9 @@ Deny from all
<FilesMatch "^akismet\.(css|js)$">
Allow from all
</FilesMatch>
#allow access to any image
<FilesMatch "^(.+)\.(png|gif)$">
Allow from all
</FilesMatch>
+267 -189
View File
@@ -10,9 +10,9 @@ function akismet_admin_init() {
if ( !function_exists('is_multisite') && version_compare( $wp_version, '3.0', '<' ) ) {
function akismet_version_warning() {
echo "
<div id='akismet-warning' class='updated fade'><p><strong>".sprintf(__('Akismet %s requires WordPress 3.0 or higher.'), AKISMET_VERSION) ."</strong> ".sprintf(__('Please <a href="%s">upgrade WordPress</a> to a current version, or <a href="%s">downgrade to version 2.4 of the Akismet plugin</a>.'), 'http://codex.wordpress.org/Upgrading_WordPress', 'http://wordpress.org/extend/plugins/akismet/download/'). "</p></div>
";
echo '
<div id="akismet-warning" class="updated fade"><p><strong>'.sprintf(__('Akismet %s requires WordPress 3.0 or higher.'), AKISMET_VERSION) .'</strong> '.sprintf(__('Please <a href="%s">upgrade WordPress</a> to a current version, or <a href="%s">downgrade to version 2.4 of the Akismet plugin</a>.'), 'http://codex.wordpress.org/Upgrading_WordPress', 'http://wordpress.org/extend/plugins/akismet/download/'). '</p></div>
';
}
add_action('admin_notices', 'akismet_version_warning');
@@ -31,13 +31,14 @@ add_action( 'admin_enqueue_scripts', 'akismet_load_js_and_css' );
function akismet_load_js_and_css() {
global $hook_suffix;
if (
$hook_suffix == 'index.php' # dashboard
|| $hook_suffix == 'edit-comments.php'
|| $hook_suffix == 'comment.php'
|| $hook_suffix == 'post.php'
|| $hook_suffix == 'plugins_page_akismet-key-config'
) {
if ( in_array( $hook_suffix, array(
'index.php', # dashboard
'edit-comments.php',
'comment.php',
'post.php',
'plugins_page_akismet-key-config',
'jetpack_page_akismet-key-config',
) ) ) {
wp_register_style( 'akismet.css', AKISMET_PLUGIN_URL . 'akismet.css', array(), '2.5.4.4' );
wp_enqueue_style( 'akismet.css');
@@ -64,35 +65,51 @@ function akismet_plugin_action_links( $links, $file ) {
add_filter( 'plugin_action_links', 'akismet_plugin_action_links', 10, 2 );
function akismet_conf() {
global $akismet_nonce, $wpcom_api_key;
global $akismet_nonce, $current_user;
$new_key_link = 'https://akismet.com/get/';
$api_key = akismet_get_key();
$show_key_form = $api_key;
$key_status = 'empty';
$saved_ok = false;
$ms = array();
if ( isset($_POST['submit']) ) {
if ( isset( $_POST['submit'] ) ) {
if ( function_exists('current_user_can') && !current_user_can('manage_options') )
die(__('Cheatin&#8217; uh?'));
$show_key_form = true;
check_admin_referer( $akismet_nonce );
$key = preg_replace( '/[^a-h0-9]/i', '', $_POST['key'] );
$key = preg_replace( '/[^a-h0-9]/i', '', $_POST['key'] );
$home_url = parse_url( get_bloginfo('url') );
if ( empty($key) ) {
$key_status = 'empty';
$ms[] = 'new_key_empty';
delete_option('wordpress_api_key');
} elseif ( empty($home_url['host']) ) {
$key_status = 'empty';
if ( empty( $home_url['host'] ) )
$ms[] = 'bad_home_url';
} else {
$key_status = akismet_verify_key( $key );
}
if ( $key_status == 'valid' ) {
if ( empty( $key ) ) {
if ( $api_key ) {
delete_option('wordpress_api_key');
$saved_ok = true;
$ms[] = 'new_key_empty';
}
else
$ms[] = 'key_empty';
}
else
$key_status = akismet_verify_key( $key );
if ( $key != $api_key && $key_status == 'valid' ) {
update_option('wordpress_api_key', $key);
$ms[] = 'new_key_valid';
} else if ( $key_status == 'invalid' ) {
$ms[] = 'new_key_invalid';
} else if ( $key_status == 'failed' ) {
$ms[] = 'new_key_failed';
}
elseif ( $key_status == 'invalid' )
$ms[] = 'new_key_invalid';
elseif ( $key_status == 'failed' )
$ms[] = 'new_key_failed';
$api_key = $key_status == 'valid' ? $key : false;
if ( isset( $_POST['akismet_discard_month'] ) )
update_option( 'akismet_discard_month', 'true' );
@@ -103,157 +120,197 @@ function akismet_conf() {
update_option( 'akismet_show_user_comments_approved', 'true' );
else
update_option( 'akismet_show_user_comments_approved', 'false' );
if ( empty( $ms ) )
$saved_ok = true;
} elseif ( isset($_POST['check']) ) {
}
elseif ( isset( $_POST['check'] ) ) {
$show_key_form = true;
check_admin_referer( $akismet_nonce );
akismet_get_server_connectivity(0);
}
if ( empty( $key_status) || $key_status != 'valid' ) {
$key = get_option('wordpress_api_key');
if ( empty( $key ) ) {
if ( empty( $key_status ) || $key_status != 'failed' ) {
if ( akismet_verify_key( '1234567890ab' ) == 'failed' )
$ms[] = 'no_connection';
else
$ms[] = 'key_empty';
}
$key_status = 'empty';
} else {
$key_status = akismet_verify_key( $key );
if ( $show_key_form ) {
//check current key status
//only get this if showing the key form otherwise takes longer for page to load for new user
//no need to get it if we already know it and its valid
if ( in_array( $key_status, array( 'invalid', 'failed', 'empty' ) ) ) {
$key = get_option('wordpress_api_key');
if ( empty( $key ) ) {
//no key saved yet - maybe connection to Akismet down?
if ( in_array( $key_status, array( 'invalid', 'empty' ) ) ) {
if ( akismet_verify_key( '1234567890ab' ) == 'failed' )
$ms[] = 'no_connection';
}
}
else
$key_status = akismet_verify_key( $key );
}
if ( $key_status == 'valid' ) {
$ms[] = 'key_valid';
} else if ( $key_status == 'invalid' ) {
$ms[] = 'key_invalid';
} else if ( !empty($key) && $key_status == 'failed' ) {
$ms[] = 'key_failed';
if ( !isset( $_POST['submit'] ) ) {
if ( $key_status == 'invalid' )
$ms[] = 'key_invalid';
elseif ( !empty( $key ) && $key_status == 'failed' )
$ms[] = 'key_failed';
}
}
$messages = array(
'new_key_empty' => array('color' => 'aa0', 'text' => __('Your key has been cleared.')),
'new_key_valid' => array('color' => '4AB915', 'text' => __('Your key has been verified. Happy blogging!')),
'new_key_invalid' => array('color' => '888', 'text' => __('The key you entered is invalid. Please double-check it.')),
'new_key_failed' => array('color' => '888', 'text' => __('The key you entered could not be verified because a connection to akismet.com could not be established. Please check your server configuration.')),
'no_connection' => array('color' => '888', 'text' => __('There was a problem connecting to the Akismet server. Please check your server configuration.')),
'key_empty' => array('color' => 'aa0', 'text' => sprintf(__('Please enter an API key. (<a href="%s" style="color:#fff">Get your key.</a>)'), 'http://akismet.com/get/?return=true')),
'key_valid' => array('color' => '4AB915', 'text' => __('This key is valid.')),
'key_invalid' => array('color' => '888', 'text' => __('This key is invalid.')),
'key_failed' => array('color' => 'aa0', 'text' => __('The key below was previously validated but a connection to akismet.com can not be established at this time. Please check your server configuration.')),
'bad_home_url' => array('color' => '888', 'text' => sprintf( __('Your WordPress home URL %s is invalid. Please fix the <a href="%s">home option</a>.'), esc_html( get_bloginfo('url') ), admin_url('options.php#home') ) ),
'new_key_empty' => array( 'class' => 'updated fade', 'text' => __('Your key has been cleared.' ) ),
'new_key_valid' => array( 'class' => 'updated fade', 'text' => __('Your Akismet account has been successfully set up and activated. Happy blogging!' ) ),
'new_key_invalid' => array( 'class' => 'error', 'text' => __('The key you entered is invalid. Please double-check it.' ) ),
'new_key_failed' => array( 'class' => 'error', 'text' => __('The key you entered could not be verified because a connection to akismet.com could not be established. Please check your server configuration.' ) ),
'no_connection' => array( 'class' => 'error', 'text' => __('There was a problem connecting to the Akismet server. Please check your server configuration.' ) ),
'key_empty' => array( 'class' => 'updated fade', 'text' => __('Please enter an API key' ) ),
'key_invalid' => array( 'class' => 'error', 'text' => __('This key is invalid.' ) ),
'key_failed' => array( 'class' => 'error', 'text' => __('The key below was previously validated but a connection to akismet.com can not be established at this time. Please check your server configuration.' ) ),
'bad_home_url' => array( 'class' => 'error', 'text' => sprintf( __('Your WordPress home URL %s is invalid. Please fix the <a href="%s">home option</a>.'), esc_html( get_bloginfo('url') ), admin_url('options.php#home') ) )
);
?>
<?php if ( !empty($_POST['submit'] ) ) : ?>
<div id="message" class="updated fade"><p><strong><?php _e('Options saved.') ?></strong></p></div>
<?php endif; ?>
<div class="wrap">
<h2><?php _e('Akismet Configuration'); ?></h2>
<?php if (isset($_GET['message']) && $_GET['message'] == 'success') { ?>
<div class="updated below-h2" id="message"><p><?php _e( '<strong>Sign up success!</strong> Please check your email for your Akismet API Key and enter it below.' ); ?></p></div>
<?php } ?>
<div class="narrow">
<form action="" method="post" id="akismet-conf" style="margin: auto; width: 400px; ">
<?php if ( !$wpcom_api_key ) { ?>
<p><?php printf(__('For many people, <a href="%1$s">Akismet</a> will greatly reduce or even completely eliminate the comment and trackback spam you get on your site. If one does happen to get through, simply mark it as "spam" on the moderation screen and Akismet will learn from the mistakes. If you don\'t have an API key yet, you can get one at <a href="%2$s">Akismet.com</a>.'), 'http://akismet.com/?return=true', 'http://akismet.com/get/?return=true'); ?></p>
<h3><label for="key"><?php _e('Akismet API Key'); ?></label></h3>
<?php foreach ( $ms as $m ) : ?>
<p style="padding: .5em; background-color: #<?php echo $messages[$m]['color']; ?>; color: #fff; font-weight: bold;"><?php echo $messages[$m]['text']; ?></p>
<?php endforeach; ?>
<p><input id="key" name="key" type="text" size="15" maxlength="12" value="<?php echo get_option('wordpress_api_key'); ?>" style="font-family: 'Courier New', Courier, mono; font-size: 1.5em;" /> (<?php _e('<a href="http://akismet.com/get/?return=true">What is this?</a>'); ?>)</p>
<?php if ( isset( $invalid_key) && $invalid_key ) { ?>
<h3><?php _e('Why might my key be invalid?'); ?></h3>
<p><?php _e('This can mean one of two things, either you copied the key wrong or that the plugin is unable to reach the Akismet servers, which is most often caused by an issue with your web host around firewalls or similar.'); ?></p>
<?php } ?>
<?php } ?>
<?php akismet_nonce_field($akismet_nonce) ?>
<p><label><input name="akismet_discard_month" id="akismet_discard_month" value="true" type="checkbox" <?php if ( get_option('akismet_discard_month') == 'true' ) echo ' checked="checked" '; ?> /> <?php _e('Auto-delete spam submitted on posts more than a month old.'); ?></label></p>
<p><label><input name="akismet_show_user_comments_approved" id="akismet_show_user_comments_approved" value="true" type="checkbox" <?php if ( get_option('akismet_show_user_comments_approved') == 'true' ) echo ' checked="checked" '; ?> /> <?php _e('Show the number of comments you\'ve approved beside each comment author.'); ?></label></p>
<p class="submit"><input type="submit" name="submit" value="<?php _e('Update options &raquo;'); ?>" /></p>
</form>
<form action="" method="post" id="akismet-connectivity" style="margin: auto; width: 400px; ">
<h3><?php _e('Server Connectivity'); ?></h3>
<?php
if ( !function_exists('fsockopen') || !function_exists('gethostbynamel') ) {
?>
<p style="padding: .5em; background-color: #888; color: #fff; font-weight:bold;"><?php _e('Network functions are disabled.'); ?></p>
<p><?php echo sprintf( __('Your web host or server administrator has disabled PHP\'s <code>fsockopen</code> or <code>gethostbynamel</code> functions. <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\'s system requirements</a>.'), 'http://blog.akismet.com/akismet-hosting-faq/'); ?></p>
<?php
} else {
$servers = akismet_get_server_connectivity();
$fail_count = count($servers) - count( array_filter($servers) );
if ( is_array($servers) && count($servers) > 0 ) {
// some connections work, some fail
if ( $fail_count > 0 && $fail_count < count($servers) ) { ?>
<p style="padding: .5em; background-color: #aa0; color: #fff; font-weight:bold;"><?php _e('Unable to reach some Akismet servers.'); ?></p>
<p><?php echo sprintf( __('A network problem or firewall is blocking some connections from your web server to Akismet.com. Akismet is working but this may cause problems during times of network congestion. Please contact your web host or firewall administrator and give them <a href="%s" target="_blank">this information about Akismet and firewalls</a>.'), 'http://blog.akismet.com/akismet-hosting-faq/'); ?></p>
<?php
// all connections fail
} elseif ( $fail_count > 0 ) { ?>
<p style="padding: .5em; background-color: #888; color: #fff; font-weight:bold;"><?php _e('Unable to reach any Akismet servers.'); ?></p>
<p><?php echo sprintf( __('A network problem or firewall is blocking all connections from your web server to Akismet.com. <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 and firewalls</a>.'), 'http://blog.akismet.com/akismet-hosting-faq/'); ?></p>
<?php
// all connections work
} else { ?>
<p style="padding: .5em; background-color: #4AB915; color: #fff; font-weight:bold;"><?php _e('All Akismet servers are available.'); ?></p>
<p><?php _e('Akismet is working correctly. All servers are accessible.'); ?></p>
<?php
}
} else {
?>
<p style="padding: .5em; background-color: #888; color: #fff; font-weight:bold;"><?php _e('Unable to find Akismet servers.'); ?></p>
<p><?php echo sprintf( __('A DNS problem or firewall is preventing all access from your web server to Akismet.com. <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 and firewalls</a>.'), 'http://blog.akismet.com/akismet-hosting-faq/'); ?></p>
<?php
}
}
if ( !empty($servers) ) {
?>
<table style="width: 100%;">
<thead><th><?php _e('Akismet server'); ?></th><th><?php _e('Network Status'); ?></th></thead>
<tbody>
<?php
asort($servers);
foreach ( $servers as $ip => $status ) {
$color = ( $status ? '#4AB915' : '#888');
?>
<tr>
<td><?php echo htmlspecialchars($ip); ?></td>
<td style="padding: 0 .5em; font-weight:bold; color: #fff; background-color: <?php echo $color; ?>"><?php echo ($status ? __('Accessible') : __('Re-trying') ); ?></td>
<?php if ( !$api_key ) : ?>
<h2 class="ak-header"><?php _e('Akismet'); ?></h2>
<?php else: ?>
<h2 class="ak-header"><?php printf( __( 'Akismet <a href="%s" class="add-new-h2">Stats</a>' ), esc_url( add_query_arg( array( 'page' => 'akismet-stats-display' ), class_exists( 'Jetpack' ) ? admin_url( 'admin.php' ) : admin_url( 'index.php' ) ) ) ); ?></h2>
<?php endif; ?>
<div class="no-key <?php echo $show_key_form ? 'hidden' : '';?>">
<p><?php _e('Akismet eliminates the comment and trackback spam you get on your site. To use Akismet you may need to sign up for an API key. Click the button below to get started.'); ?></p>
<form name="akismet_activate" action="https://akismet.com/get/" method="POST">
<input type="hidden" name="return" value="1"/>
<input type="hidden" name="jetpack" value="<?php echo (string) class_exists( 'Jetpack' );?>"/>
<input type="hidden" name="user" value="<?php echo esc_attr( $current_user->user_login );?>"/>
<input type="submit" class="button button-primary" value="<?php echo esc_attr( __('Create a new Akismet Key') ); ?>"/>
</form>
<br/>
<a href="#" class="switch-have-key"><?php _e('I already have a key'); ?></a>
</div>
<div class="have-key <?php echo $show_key_form ? '' : 'hidden';?>">
<?php if ( !empty($_POST['submit'] ) && $saved_ok ) : ?>
<div id="message" class="updated fade"><p><strong><?php _e('Settings saved.') ?></strong></p></div>
<?php endif; ?>
<?php if ( isset($_GET['message']) && $_GET['message'] == 'success' ) : ?>
<div id="message" class="updated fade"><p><?php _e('<strong>Sign up success!</strong> Please check your email for your Akismet API Key and enter it below.') ?></p></div>
<?php endif; ?>
<?php foreach( $ms as $m ) : ?>
<div class="<?php echo $messages[$m]['class']; ?>"><p><strong><?php echo $messages[$m]['text']; ?></strong></p></div>
<?php endforeach; ?>
<form action="" method="post" id="akismet-conf">
<table class="form-table">
<tbody>
<tr>
<th><label for="key"><?php _e('Akismet API Key');?></label></th>
<td>
<input id="key" name="key" type="text" size="15" maxlength="12" value="<?php echo esc_html( get_option('wordpress_api_key') ); ?>" class="regular-text code <?php echo $key_status;?>"><div class="under-input key-status <?php echo $key_status;?>"><?php echo ucfirst( $key_status );?></div>
<p class="need-key description"><?php printf( __('You must enter a valid Akismet API key here. If you need an API key, you can <a href="%s">create one here</a>'), '#' );?></p>
</td>
</tr>
<?php if ( $api_key ):?>
<tr valign="top">
<th scope="row"><?php _e('Settings');?></th>
<td>
<fieldset><legend class="screen-reader-text"><span><?php _e('Settings');?></span></legend>
<label for="akismet_discard_month" title="<?php echo esc_attr( __( 'Auto-detete old spam' ) ); ?>"><input name="akismet_discard_month" id="akismet_discard_month" value="true" type="checkbox" <?php echo get_option('akismet_discard_month') == 'true' ? 'checked="checked"':''; ?>> <span><?php _e('Auto-delete spam submitted on posts more than a month old.'); ?></span></label><br>
<label for="akismet_show_user_comments_approved" title="<?php echo esc_attr( __( 'Show approved comments' ) ); ?>"><input name="akismet_show_user_comments_approved" id="akismet_show_user_comments_approved" value="true" type="checkbox" <?php echo get_option('akismet_show_user_comments_approved') == 'true' ? 'checked="checked"':''; ?>> <span><?php _e('Show the number of comments you\'ve approved beside each comment author.'); ?></span></label>
</fieldset>
</td>
</tr>
<?php endif; ?>
</tbody>
</table>
<?php akismet_nonce_field($akismet_nonce) ?>
<p class="submit">
<input type="submit" name="submit" id="submit" class="button button-primary" value="<?php _e('Save Changes');?>">
</p>
</form>
<?php
}
}
?>
</tbody>
</table>
<p><?php if ( get_option('akismet_connectivity_time') ) echo sprintf( __('Last checked %s ago.'), human_time_diff( get_option('akismet_connectivity_time') ) ); ?></p>
<p class="submit"><input type="submit" name="check" value="<?php _e('Check network status &raquo;'); ?>" /></p>
<p><?php printf( __('<a href="%s" target="_blank">Click here</a> to confirm that <a href="%s" target="_blank">Akismet.com is up</a>.'), 'http://status.automattic.com/9931/136079/Akismet-API', 'http://status.automattic.com/9931/136079/Akismet-API' ); ?></p>
</form>
</div>
<?php if ( $api_key ) : ?>
<h3><?php _e('Server Connectivity'); ?></h3>
<form action="" method="post" id="akismet-connectivity">
<table class="form-table">
<tbody>
<tr>
<th><label for="key"><?php _e('Server Status');?></label></th>
<td>
<?php if ( !function_exists('fsockopen') || !function_exists('gethostbynamel') ) : ?>
<p class="key-status failed"><?php _e('Network functions are disabled.'); ?></p>
<p class="description"><?php echo sprintf( __('Your web host or server administrator has disabled PHP\'s <code>fsockopen</code> or <code>gethostbynamel</code> functions. <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\'s system requirements</a>.'), 'http://blog.akismet.com/akismet-hosting-faq/'); ?></p>
<?php else :
$servers = akismet_get_server_connectivity();
$fail_count = count( $servers ) - count( array_filter( $servers ) );
if ( is_array( $servers ) && count( $servers ) > 0 ) {
if ( $fail_count > 0 && $fail_count < count( $servers ) ) { // some connections work, some fail ?>
<p class="key-status some"><?php _e('Unable to reach some Akismet servers.'); ?></p>
<p class="description"><?php echo sprintf( __('A network problem or firewall is blocking some connections from your web server to Akismet.com. Akismet is working but this may cause problems during times of network congestion. Please contact your web host or firewall administrator and give them <a href="%s" target="_blank">this information about Akismet and firewalls</a>.'), 'http://blog.akismet.com/akismet-hosting-faq/'); ?></p>
<?php } elseif ( $fail_count > 0 ) { // all connections fail ?>
<p class="key-status failed"><?php _e('Unable to reach any Akismet servers.'); ?></p>
<p class="description"><?php echo sprintf( __('A network problem or firewall is blocking all connections from your web server to Akismet.com. <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 and firewalls</a>.'), 'http://blog.akismet.com/akismet-hosting-faq/'); ?></p>
<?php } else { // all connections work ?>
<p class="key-status valid"><?php _e('All Akismet servers are available.'); ?></p>
<p class="description"><?php _e('Akismet is working correctly. All servers are accessible.'); ?></p>
<?php }
} else { //can't connect to any server ?>
<p class="key-status failed"><?php _e('Unable to find Akismet servers.'); ?></p>
<p class="description"><?php echo sprintf( __('A DNS problem or firewall is preventing all access from your web server to Akismet.com. <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 and firewalls</a>.'), 'http://blog.akismet.com/akismet-hosting-faq/'); ?></p>
<?php }
endif; ?>
</td>
</tr>
<?php if ( !empty( $servers ) ) : ?>
<tr valign="top">
<th scope="row"><?php _e('Network Status');?></th>
<td>
<table class="network-status">
<thead>
<th><?php _e('Akismet server'); ?></th><th><?php _e('Network Status'); ?></th>
</thead>
<tbody>
<?php
asort($servers);
foreach ( $servers as $ip => $status ) : ?>
<tr>
<td align="center"><?php echo esc_html( $ip ); ?></td>
<td class="key-status <?php echo $status ? 'valid' : 'failed'; ?>"><?php echo $status ? __('Accessible') : __('Re-trying'); ?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<br/>
<input type="submit" name="check" id="submit" class="button" style="margin-left: 13.3em;" value="<?php _e('Check Network Status');?>">
</td>
</tr>
<?php endif; ?>
<tr valign="top">
<th scope="row"><?php _e('Last Checked');?></th>
<td>
<p><strong><?php echo get_option('akismet_connectivity_time') ? sprintf( __('%s Ago'), ucwords( human_time_diff( get_option('akismet_connectivity_time') ) ) ) : __( 'Not yet' ); ?></strong></p>
<p class="description"><?php printf( __('You can confirm that Akismet.com is up by <a href="%s" target="_blank">clicking here</a>.'), 'http://status.automattic.com/9931/136079/Akismet-API' ); ?></p>
</td>
</tbody>
</table>
<?php akismet_nonce_field($akismet_nonce) ?>
</form>
<?php endif;?>
</div>
</div>
<?php
}
function akismet_stats_display() {
global $akismet_api_host, $akismet_api_port, $wpcom_api_key;
$blog = urlencode( get_bloginfo('url') );
$url = 'http://';
if ( is_ssl() )
$url = 'https://';
$url .= 'akismet.com/web/1.0/user-stats.php';
$url .= "?blog={$blog}&api_key=" . akismet_get_key();
?>
<div class="wrap">
<iframe src="<?php echo $url; ?>" width="100%" height="2500px" frameborder="0" id="akismet-stats-frame"></iframe>
</div>
<?php
global $akismet_api_host, $akismet_api_port;
$blog = urlencode( get_bloginfo('url') );
$api_key = akismet_get_key();?>
<div class="wrap"><?php
if ( !$api_key ) :?>
<div id="akismet-warning" class="updated fade"><p><strong><?php _e('Akismet is almost ready.');?></strong> <?php printf( __( 'You must <a href="%1$s">enter your Akismet API key</a> for it to work.' ), esc_url( add_query_arg( array( 'page' => 'akismet-key-config' ), admin_url( 'admin.php' ) ) ) );?></p></div><?php
else :?>
<iframe src="<?php echo esc_url( sprintf( '%s://akismet.com/web/1.0/user-stats.php?blog=%s&api_key=%s', is_ssl()?'https':'http', $blog, $api_key ) ); ?>" width="100%" height="2500px" frameborder="0" id="akismet-stats-frame"></iframe><?php
endif;?>
</div><?php
}
function akismet_stats() {
@@ -288,9 +345,11 @@ function akismet_admin_warnings() {
);
?>
<div class='error'>
<p><strong>Akismet Error Code: <?php echo $alert['code']; ?></strong></p>
<p><strong><?php _e( 'Akismet Error Code');?>: <?php echo $alert['code']; ?></strong></p>
<p><?php esc_html_e( $alert['msg'] ); ?></p>
<p>More information is available at <a href="https://akismet.com/errors/<?php echo $alert['code']; ?>">https://akismet.com/errors/<?php echo $alert['code']; ?></a></p>
<p><?php //FIXME: need to revert this to using __() in next version
printf( translate( 'For more information:' ) . ' <a href="%s">%s</a>' , 'https://akismet.com/errors/'.$alert['code'], 'https://akismet.com/errors/'.$alert['code'] );?>
</p>
</div>
<?php
}
@@ -301,10 +360,33 @@ function akismet_admin_warnings() {
if ( !get_option('wordpress_api_key') && !$wpcom_api_key && !isset($_POST['submit']) ) {
function akismet_warning() {
echo "
<div id='akismet-warning' class='updated fade'><p><strong>".__('Akismet is almost ready.')."</strong> ".sprintf(__('You must <a href="%1$s">enter your Akismet API key</a> for it to work.'), "admin.php?page=akismet-key-config")."</p></div>
";
global $hook_suffix, $current_user;
if ( $hook_suffix == 'plugins.php' ) {
echo '
<div class="updated" style="padding: 0; margin: 0; border: none; background: none;">
<style type="text/css">
.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}.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{cursor:pointer;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}
</style>
<form name="akismet_activate" action="https://akismet.com/get/" method="POST">
<input type="hidden" name="return" value="1"/>
<input type="hidden" name="jetpack" value="'.(string) class_exists( 'Jetpack' ).'"/>
<input type="hidden" name="user" value="'.esc_attr( $current_user->user_login ).'"/>
<div class="akismet_activate">
<div class="aa_a">A</div>
<div class="aa_button_container" onclick="document.akismet_activate.submit();">
<div class="aa_button_border">
<div class="aa_button">Activate your Akismet account</div>
</div>
</div>
<div class="aa_description"><strong>Almost done</strong> - activate your account and say goodbye to comment spam.</div>
</div>
</form>
</div>
';
}
}
add_action('admin_notices', 'akismet_warning');
return;
} elseif ( ( empty($_SERVER['SCRIPT_FILENAME']) || basename($_SERVER['SCRIPT_FILENAME']) == 'edit-comments.php' ) && wp_next_scheduled('akismet_schedule_cron_recheck') ) {
@@ -314,9 +396,9 @@ function akismet_admin_warnings() {
$waiting = $wpdb->get_var( "SELECT COUNT(*) FROM $wpdb->commentmeta WHERE meta_key = 'akismet_error'" );
$next_check = wp_next_scheduled('akismet_schedule_cron_recheck');
if ( $waiting > 0 && $next_check > time() )
echo "
<div id='akismet-warning' class='updated fade'><p><strong>".__('Akismet has detected a problem.')."</strong> ".sprintf(__('Some comments have not yet been checked for spam by Akismet. They have been temporarily held for moderation. Please check your <a href="%s">Akismet configuration</a> and contact your web host if problems persist.'), 'admin.php?page=akismet-key-config')."</p></div>
";
echo '
<div id="akismet-warning" class="updated fade"><p><strong>'.__('Akismet has detected a problem.').'</strong> '.sprintf(__('Some comments have not yet been checked for spam by Akismet. They have been temporarily held for moderation. Please check your <a href="%s">Akismet configuration</a> and contact your web host if problems persist.'), 'admin.php?page=akismet-key-config').'</p></div>
';
}
add_action('admin_notices', 'akismet_warning');
return;
@@ -332,8 +414,8 @@ function akismet_comment_row_action( $a, $comment ) {
return $a;
$akismet_result = get_comment_meta( $comment->comment_ID, 'akismet_result', true );
$akismet_error = get_comment_meta( $comment->comment_ID, 'akismet_error', true );
$user_result = get_comment_meta( $comment->comment_ID, 'akismet_user_result', true);
$akismet_error = get_comment_meta( $comment->comment_ID, 'akismet_error', true );
$user_result = get_comment_meta( $comment->comment_ID, 'akismet_user_result', true);
$comment_status = wp_get_comment_status( $comment->comment_ID );
$desc = null;
if ( $akismet_error ) {
@@ -369,7 +451,7 @@ function akismet_comment_row_action( $a, $comment ) {
}
if ( $desc )
echo '<span class="akismet-status" commentid="'.$comment->comment_ID.'"><a href="comment.php?action=editcomment&amp;c='.$comment->comment_ID.'#akismet-status" title="' . esc_attr__( 'View comment history' ) . '">'.htmlspecialchars($desc).'</a></span>';
echo '<span class="akismet-status" commentid="'.$comment->comment_ID.'"><a href="comment.php?action=editcomment&amp;c='.$comment->comment_ID.'#akismet-status" title="' . esc_attr__( 'View comment history' ) . '">'.esc_html( $desc ).'</a></span>';
if ( apply_filters( 'akismet_show_user_comments_approved', get_option('akismet_show_user_comments_approved') ) == 'true' ) {
$comment_count = akismet_get_user_comments_approved( $comment->user_id, $comment->comment_author_email, $comment->comment_author, $comment->comment_author_url );
@@ -390,7 +472,7 @@ function akismet_comment_status_meta_box($comment) {
foreach ( $history as $row ) {
$time = date( 'D d M Y @ h:i:m a', $row['time'] ) . ' GMT';
echo '<div style="margin-bottom: 13px;"><span style="color: #999;" alt="' . $time . '" title="' . $time . '">' . sprintf( __('%s ago'), human_time_diff( $row['time'] ) ) . '</span> - ';
echo htmlspecialchars( $row['message'] ) . '</div>';
echo esc_html( $row['message'] ) . '</div>';
}
echo '</div>';
@@ -418,7 +500,7 @@ function akismet_comment_column_row( $column, $comment_id ) {
echo '<dl class="akismet-history">';
foreach ( $history as $row ) {
echo '<dt>' . sprintf( __('%s ago'), human_time_diff( $row['time'] ) ) . '</dt>';
echo '<dd>' . htmlspecialchars( $row['message'] ) . '</dd>';
echo '<dd>' . esc_html( $row['message'] ) . '</dd>';
}
echo '</dl>';
@@ -430,18 +512,16 @@ function akismet_comment_column_row( $column, $comment_id ) {
// END FIXME
// call out URLS in comments
function akismet_text_add_link_callback( $m ) {
// bare link?
if ( $m[4] == $m[2] )
return '<a '.$m[1].' href="'.$m[2].'" '.$m[3].' class="comment-link">'.$m[4].'</a>';
else
return '<span title="'.$m[2].'" class="comment-link"><a '.$m[1].' href="'.$m[2].'" '.$m[3].' class="comment-link">'.$m[4].'</a></span>';
function akismet_text_add_link_callback( $m ) {
// bare link?
if ( $m[4] == $m[2] )
return '<a '.$m[1].' href="'.$m[2].'" '.$m[3].' class="comment-link">'.$m[4].'</a>';
else
return '<span title="'.$m[2].'" class="comment-link"><a '.$m[1].' href="'.$m[2].'" '.$m[3].' class="comment-link">'.$m[4].'</a></span>';
}
function akismet_text_add_link_class( $comment_text ) {
return preg_replace_callback( '#<a ([^>]*)href="([^"]+)"([^>]*)>(.*?)</a>#i', 'akismet_text_add_link_callback', $comment_text );
return preg_replace_callback( '#<a ([^>]*)href="([^"]+)"([^>]*)>(.*?)</a>#i', 'akismet_text_add_link_callback', $comment_text );
}
add_filter('comment_text', 'akismet_text_add_link_class');
@@ -516,7 +596,6 @@ function akismet_submit_nonspam_comment ( $comment_id ) {
$comment->blog_lang = get_locale();
$comment->blog_charset = get_option('blog_charset');
$comment->permalink = get_permalink($comment->comment_post_ID);
$comment->reporter_ip = $_SERVER['REMOTE_ADDR'];
if ( is_object($current_user) ) {
$comment->reporter = $current_user->user_login;
}
@@ -568,7 +647,6 @@ function akismet_submit_spam_comment ( $comment_id ) {
$comment->blog_lang = get_locale();
$comment->blog_charset = get_option('blog_charset');
$comment->permalink = get_permalink($comment->comment_post_ID);
$comment->reporter_ip = $_SERVER['REMOTE_ADDR'];
if ( is_object($current_user) ) {
$comment->reporter = $current_user->user_login;
}
@@ -822,12 +900,12 @@ function akismet_admin_menu() {
}
}
function akismet_load_menu() {
function akismet_load_menu() {
if ( class_exists( 'Jetpack' ) ) {
add_submenu_page( 'jetpack', __( 'Akismet Configuration' ), __( 'Akismet Configuration' ), 'manage_options', 'akismet-key-config', 'akismet_conf' );
add_submenu_page( 'jetpack', __( 'Akismet' ), __( 'Akismet' ), 'manage_options', 'akismet-key-config', 'akismet_conf' );
add_submenu_page( 'jetpack', __( 'Akismet Stats' ), __( 'Akismet Stats' ), 'manage_options', 'akismet-stats-display', 'akismet_stats_display' );
} else {
add_submenu_page('plugins.php', __('Akismet Configuration'), __('Akismet Configuration'), 'manage_options', 'akismet-key-config', 'akismet_conf');
add_submenu_page('plugins.php', __('Akismet'), __('Akismet'), 'manage_options', 'akismet-key-config', 'akismet_conf');
add_submenu_page('index.php', __('Akismet Stats'), __('Akismet Stats'), 'manage_options', 'akismet-stats-display', 'akismet_stats_display');
}
}
+1 -12
View File
@@ -1,12 +1 @@
#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 .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; } /* never show the flagged by text on the dashboard */
.akismet-status { float: right; }
.akismet-status a { color: #AAA; font-style: italic; }
span.comment-link a { text-decoration: underline; }
span.comment-link:after { content: " " attr(title) " "; color: #aaa; text-decoration: none; }
.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; }
#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 .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}span.comment-link a{text-decoration:underline}span.comment-link:after{content:" "attr(title) " ";color:#aaa;text-decoration:none}.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}h2.ak-header{padding-left:38px;background:url('img/logo.png') no-repeat 0 9px;margin-bottom:14px;line-height:32px}.key-status{padding:0.4em 1em;color:#fff;font-weight:bold;text-align:center;-webkit-border-radius:3px;border-radius:3px;border-width:1px;border-style:solid;max-width:23.3em}input#key{width:25.3em !important}input#key.valid{border-color:#4F800D}input#key.invalid,input#key.failed{border-color:#888}.key-status.under-input{margin-top:-5px;padding-bottom:0px}.key-status.invalid,.key-status.failed{background-color:#888}.key-status.valid{background-color:#4F800D}.key-status.some{background-color:#993300}.key-status.empty{display:none}table.network-status th,table.network-status td{padding:0.4em;margin:0;text-align:center}table.network-status{border-color:#dfdfdf;border-width:0 0 1px 1px;border-style:solid;border-spacing:0;width:25.6em}table.network-status th,table.network-status td{border-color:#dfdfdf;border-width:1px 1px 0 0;border-style:solid;margin:0;border-spacing:0}table.network-status td.key-status{border-radius:0px;-webkit-border-radius:0px}
+12
View File
@@ -1,4 +1,16 @@
jQuery(document).ready(function () {
jQuery( '.switch-have-key' ).click( function() {
var no_key = jQuery( this ).parents().find('div.no-key');
var have_key = jQuery( this ).parents().find('div.have-key');
no_key.addClass( 'hidden' );
have_key.removeClass( 'hidden' );
return false;
});
jQuery( 'p.need-key a' ).click( function(){
document.akismet_activate.submit();
});
jQuery('.akismet-status').each(function () {
var thisId = jQuery(this).attr('commentid');
jQuery(this).prependTo('#comment-' + thisId + ' .column-comment div:first-child');
+2 -2
View File
@@ -6,7 +6,7 @@
Plugin Name: Akismet
Plugin URI: http://akismet.com/?return=true
Description: Used by millions, Akismet is quite possibly the best way in the world to <strong>protect your blog from comment and trackback spam</strong>. It keeps your site protected from spam even while you sleep. To get started: 1) Click the "Activate" link to the left of this description, 2) <a href="http://akismet.com/get/?return=true">Sign up for an Akismet API key</a>, and 3) Go to your Akismet configuration page, and save your API key.
Version: 2.5.7
Version: 2.5.8
Author: Automattic
Author URI: http://automattic.com/wordpress-plugins/
License: GPLv2 or later
@@ -34,7 +34,7 @@ if ( !function_exists( 'add_action' ) ) {
exit;
}
define('AKISMET_VERSION', '2.5.7');
define('AKISMET_VERSION', '2.5.8');
define('AKISMET_PLUGIN_URL', plugin_dir_url( __FILE__ ));
/** If you hardcode a WP.com API key here, all key config screens will be hidden */
+8 -3
View File
@@ -1,9 +1,9 @@
=== Akismet ===
Contributors: matt, ryan, andy, mdawaffe, tellyworth, josephscott, lessbloat, automattic
Contributors: matt, ryan, andy, mdawaffe, tellyworth, josephscott, lessbloat, eoigal, automattic
Tags: akismet, comments, spam
Requires at least: 3.0
Tested up to: 3.5
Stable tag: 2.5.7
Tested up to: 3.6
Stable tag: 2.5.8
License: GPLv2 or later
Akismet checks your comments against the Akismet web service to see if they look like spam or not.
@@ -31,6 +31,11 @@ Upload the Akismet plugin to your blog, Activate it, then enter your [Akismet.co
== Changelog ==
= 2.5.8 =
* Simplify the activation process for new users
* Remove the reporter_ip parameter
* Minor preventative security improvements
= 2.5.7 =
* FireFox Stats iframe preview bug
* Fix mshots preview when using https
@@ -0,0 +1,38 @@
#Contribute To WordPress SEO
Community made patches, localisations, bug reports and contributions are very welcome and help make WordPress SEO the #1 SEO plugin for WordPress.
When contributing please ensure you follow the guidelines below so that we can keep on top of things.
__Please Note:__ GitHub is for bug reports and contributions only - if you have a support question or a request for a customisation don't post here, go to our [Support Forum](http://wordpress.org/support/plugin/wordpress-seo) instead.
For localization, please refer to [translate.yoast.com](http://translate.yoast.com/projects/wordpress-seo), though bugs with strings that can't be translated are welcome here.
## Getting Started
* Submit a ticket for your issue, assuming one does not already exist.
* Raise it on our [Issue Tracker](https://github.com/jdevalk/wordpress-seo/issues)
* Clearly describe the issue including steps to reproduce the bug.
* Make sure you fill in the earliest version that you know has the issue as well as the version of WordPress you're using.
## Making Changes
* Fork the repository on GitHub
* Make the changes to your forked repository
* Ensure you stick to the [WordPress Coding Standards](http://codex.wordpress.org/WordPress_Coding_Standards) and have properly documented any new functions.
* When committing, reference your issue (if present) and include a note about the fix.
* Push the changes to your fork and submit a pull request to the 'master' branch of the WordPress SEO repository.
## Code Documentation
* We ensure that every WordPress SEO function is documented well and follows the standards set by phpDoc.
* An example function can be found [here](https://gist.github.com/jdevalk/5574677)
* Please make sure that every function is documented so that when we update our API Documentation things don't go awry!
* Finally, please use tabs and not spaces. The tab indent size should be 8 for all WordPress SEO code.
At this point you're waiting on us to merge your pull request. We'll review all pull requests, and make suggestions and changes if necessary.
# Additional Resources
* [WordPress SEO API](http://yoast.com/wordpress/seo/api/)
* [General GitHub Documentation](http://help.github.com/)
* [GitHub Pull Request documentation](http://help.github.com/send-pull-requests/)
@@ -0,0 +1,45 @@
WordPress SEO by Yoast
======================
[![Build Status](https://travis-ci.org/jdevalk/wordpress-seo.png?branch=master)](https://travis-ci.org/jdevalk/wordpress-seo)
Welcome to the WordPress SEO Github repository
----------------------------------------------
While the documenation for the [WordPress SEO plugin](http://yoast.com/wordpress/seo/) can be found on yoast.com, here
you can browse the source of the project, find and discuss open issues and even
[contribute yourself](https://github.com/jdevalk/wordpress-seo/blob/master/CONTRIBUTING.md).
Installation
------------
Here's a [guide on how to install WordPress SEO in your WordPress site](http://yoast.com/wordpress/seo/installation/).
If you want to run the Git version though, you have two options:
* You can clone the GitHub repository: https://github.com/jdevalk/wordpress-seo.git
* Download it directly as a ZIP file: https://github.com/jdevalk/wordpress-seo/archive/master.zip
This will download the latest development version of WordPress SEO by Yoast. While this version is usually stable,
it is not recommended for use in a production environment.
Bugs
----
If you find an issue, [let us know here](https://github.com/jdevalk/wordpress-seo/issues/new)!
Support
-------
This is a developer's portal for WordPress SEO by Yoast and should not be used for support. Please visit the
[support forums](http://wordpress.org/support/plugin/wordpress-seo).
Contributions
-------------
Anyone is welcome to contribute to WordPress SEO. Please
[read the guidelines](https://github.com/jdevalk/wordpress-seo/blob/master/CONTRIBUTING.md) for contributing to this
repository.
There are various ways you can contribute:
* [Raise an issue](https://github.com/jdevalk/wordpress-seo/issues) on GitHub.
* Send us a Pull Request with your bug fixes and/or new features.
* [Translate WordPress SEO by Yoast into different languages](http://translate.yoast.com/projects/wordpress-seo/).
* Provide feedback and [suggestions on enhancements](https://github.com/jdevalk/wordpress-seo/issues?direction=desc&labels=Enhancement&page=1&sort=created&state=open).
@@ -48,6 +48,9 @@ class WPSEO_Admin {
add_action( 'edit_user_profile', array( $this, 'user_profile' ) );
add_action( 'personal_options_update', array( $this, 'process_user_option_update' ) );
add_action( 'edit_user_profile_update', array( $this, 'process_user_option_update' ) );
add_action( 'personal_options_update', array( $this, 'update_user_profile' ) );
add_action( 'edit_user_profile_update', array( $this, 'update_user_profile' ) );
add_filter( 'user_contactmethods', array( $this, 'update_contactmethods' ), 10, 1 );
add_action( 'update_option_wpseo_titles', array( $this, 'clear_cache' ) );
@@ -55,6 +58,9 @@ class WPSEO_Admin {
add_action( 'update_option_wpseo_permalinks', array( $this, 'clear_rewrites' ) );
add_action( 'update_option_wpseo_xml', array( $this, 'clear_rewrites' ) );
add_action( 'after_switch_theme', array( $this, 'switch_theme' ) );
add_action( 'switch_theme', array( $this, 'switch_theme' ) );
}
/**
@@ -133,7 +139,7 @@ class WPSEO_Admin {
* @global array $submenu used to change the label on the first item.
*/
function register_settings_page() {
add_menu_page( __( 'WordPress SEO Configuration', 'wordpress-seo' ), __( 'SEO', 'wordpress-seo' ), 'manage_options', 'wpseo_dashboard', array( $this, 'config_page' ), WPSEO_URL . 'images/yoast-icon.png' );
add_menu_page( __( 'WordPress SEO Configuration', 'wordpress-seo' ), __( 'SEO', 'wordpress-seo' ), 'manage_options', 'wpseo_dashboard', array( $this, 'config_page' ), WPSEO_URL . 'images/yoast-icon.png', '99.31337' );
add_submenu_page( 'wpseo_dashboard', __( 'Titles &amp; Metas', 'wordpress-seo' ), __( 'Titles &amp; Metas', 'wordpress-seo' ), 'manage_options', 'wpseo_titles', array( $this, 'titles_page' ) );
add_submenu_page( 'wpseo_dashboard', __( 'Social', 'wordpress-seo' ), __( 'Social', 'wordpress-seo' ), 'manage_options', 'wpseo_social', array( $this, 'social_page' ) );
add_submenu_page( 'wpseo_dashboard', __( 'XML Sitemaps', 'wordpress-seo' ), __( 'XML Sitemaps', 'wordpress-seo' ), 'manage_options', 'wpseo_xml', array( $this, 'xml_sitemaps_page' ) );
@@ -295,18 +301,20 @@ class WPSEO_Admin {
}
/**
* Filter the $contactmethods array and add Google+ and Twitter.
* Filter the $contactmethods array and add Facebook, Google+ and Twitter.
*
* These are used with the rel="author" and Twitter cards implementation.
* These are used with the Facebook author, rel="author" and Twitter cards implementation.
*
* @param array $contactmethods currently set contactmethods.
* @return array $contactmethods with added contactmethods.
*/
function update_contactmethods( $contactmethods ) {
// Add Google+
$contactmethods['googleplus'] = 'Google+';
$contactmethods['googleplus'] = __( "Google+", 'wordpress-seo' );
// Add Twitter
$contactmethods['twitter'] = __( 'Twitter username (without @)', 'wordpress-seo' );
// Add Facebook
$contactmethods['facebook'] = __( 'Facebook profile URL', 'wordpress-seo' );
return $contactmethods;
}
@@ -561,6 +569,25 @@ class WPSEO_Admin {
return false;
}
/**
* Log the timestamp when a user profile has been updated
*/
function update_user_profile($user_id) {
if ( current_user_can( 'edit_user', $user_id ) ) {
update_user_meta( $user_id, '_yoast_wpseo_profile_updated', time() );
}
}
/**
* Log the updated timestamp for user profiles when theme is changed
*/
function switch_theme() {
foreach ( get_users( array( 'who' => 'authors' ) ) as $user ) {
update_user_meta( $user->ID, '_yoast_wpseo_profile_updated', time() );
}
}
}
// Globalize the var first as it's needed globally.
@@ -107,6 +107,13 @@ class WPSEO_Admin_Pages {
'alt' => 'Banner WordPress SEO Video manual',
);
}
if ( !defined( 'WPSEO_LOCAL_VERSION' ) ) {
$banners[] = array(
'url' => 'http://yoast.com/wordpress/local-seo/#utm_source=wordpress-seo-config&utm_medium=banner&utm_campaign=local-seo-banner',
'img' => 'banner-local-seo.png',
'alt' => 'Banner Local SEO plugin',
);
}
shuffle( $banners );
?>
<div class="postbox-container" style="width:261px;">
@@ -261,6 +268,9 @@ class WPSEO_Admin_Pages {
wp_enqueue_style( 'global' );
wp_enqueue_style( 'wp-admin' );
wp_enqueue_style( 'yoast-admin-css', WPSEO_URL . 'css/yst_plugin_tools.css', WPSEO_VERSION );
if ( is_rtl() )
wp_enqueue_style( 'wpseo-rtl', WPSEO_URL . 'css/wpseo-rtl.css', WPSEO_VERSION );
}
}
@@ -269,6 +279,7 @@ class WPSEO_Admin_Pages {
*/
function config_page_scripts() {
global $pagenow;
if ( $pagenow == 'admin.php' && isset( $_GET['page'] ) && in_array( $_GET['page'], $this->adminpages ) ) {
wp_enqueue_script( 'wpseo-admin-script', WPSEO_URL . 'js/wp-seo-admin.js', array( 'jquery' ), WPSEO_VERSION, true );
wp_enqueue_script( 'postbox' );
@@ -101,7 +101,6 @@ class WPSEO_Metabox {
* Outputs the page analysis score in the Publish Box.
*/
public function publish_box() {
echo '<div class="misc-pub-section curtime misc-pub-section-last" style="height:0; padding:0; margin:0; border-top: 1px solid #DFDFDF"></div>';
echo '<div class="misc-pub-section misc-yoast misc-pub-section-last">';
if ( wpseo_get_value( 'meta-robots-noindex' ) == 1 ) {
@@ -131,10 +130,11 @@ class WPSEO_Metabox {
}
}
if ( !isset( $title ) )
$title = ucfirst( $score );
$title = wpseo_translate_score( $score, $css = false );
$result = '<div title="' . esc_attr( $title ) . '" alt="' . esc_attr( $title ) . '" class="wpseo_score_img ' . $score . '"></div>';
echo 'SEO: ' . $result . ' <a class="wpseo_tablink scroll" href="#wpseo_linkdex">Check</a>';
echo __( 'SEO: ', 'wordpress-seo' ) . $result . ' <a class="wpseo_tablink scroll" href="#wpseo_linkdex">' . __( 'Check', 'wordpress-seo' ) . '</a>';
echo '</div>';
}
@@ -262,7 +262,7 @@ class WPSEO_Metabox {
"type" => "text",
"title" => __( 'Focus Keyword', 'wordpress-seo' ),
"autocomplete" => "off",
"help" => sprintf( "Pick the main keyword or keyphrase that this post/page is about.<br/><br/>Read %sthis post%s for more info.", "<a href='http://yoast.com/focus-keyword/#utm_source=wordpress-seo-metabox&utm_medium=inline-help&utm_campaign=focus-keyword'>", '</a>' ),
"help" => sprintf( __( "Pick the main keyword or keyphrase that this post/page is about.<br/><br/>Read %sthis post%s for more info.", 'wordpress-seo' ), "<a href='http://yoast.com/focus-keyword/#utm_source=wordpress-seo-metabox&utm_medium=inline-help&utm_campaign=focus-keyword'>", '</a>' ),
"description" => "<div id='focuskwresults'></div>",
);
$mbs['title'] = array(
@@ -326,8 +326,8 @@ class WPSEO_Metabox {
"type" => "select",
"options" => array(
"0" => sprintf( __( "Default for post type, currently: %s", 'wordpress-seo' ), ( isset( $options['noindex-' . $post_type] ) && $options['noindex-' . $post_type] ) ? 'noindex' : 'index' ),
"2" => "index",
"1" => "noindex",
"2" => __( "index", 'wordpress-seo' ),
"1" => __( "noindex", 'wordpress-seo' ),
),
);
$mbs['meta-robots-nofollow'] = array(
@@ -396,14 +396,26 @@ class WPSEO_Metabox {
),
);
}
$mbs['canonical'] = array(
$mbs['sitemap-html-include'] = array(
"name" => "sitemap-html-include",
"std" => "-",
"type" => "select",
"title" => __( "Include in HTML Sitemap", 'wordpress-seo' ),
"description" => __( "Should this page be in the HTML Sitemap at all times, regardless of Robots Meta settings?", 'wordpress-seo' ),
"options" => array(
"-" => __( "Auto detect", 'wordpress-seo' ),
"always" => __( "Always include", 'wordpress-seo' ),
"never" => __( "Never include", 'wordpress-seo' ),
),
);
$mbs['canonical'] = array(
"name" => "canonical",
"std" => "",
"type" => "text",
"title" => __( "Canonical URL", 'wordpress-seo' ),
"description" => sprintf( __( "The canonical URL that this page should point to, leave empty to default to permalink. %sCross domain canonical%s supported too.", 'wordpress-seo' ), "<a target='_blank' href='http://googlewebmastercentral.blogspot.com/2009/12/handling-legitimate-cross-domain.html'>", "</a>" )
);
$mbs['redirect'] = array(
$mbs['redirect'] = array(
"name" => "redirect",
"std" => "",
"type" => "text",
@@ -451,7 +463,7 @@ class WPSEO_Metabox {
$this->do_tab( 'linkdex', __( 'Page Analysis', 'wordpress-seo' ), $this->linkdex_output( $post ) );
if ( current_user_can( 'edit_users' ) || !isset( $options['disableadvanced_meta'] ) || !$options['disableadvanced_meta'] ) {
if ( current_user_can( 'manage_options' ) || !isset( $options['disableadvanced_meta'] ) || !$options['disableadvanced_meta'] ) {
$content = '';
foreach ( $this->get_advanced_meta_boxes() as $meta_box ) {
$content .= $this->do_meta_box( $meta_box );
@@ -758,6 +770,16 @@ class WPSEO_Metabox {
wp_enqueue_script( 'jquery-ui-autocomplete', WPSEO_URL . 'js/jquery-ui-autocomplete.min.js', array( 'jquery', 'jquery-ui-core' ), WPSEO_VERSION, true );
wp_enqueue_script( 'jquery-qtip', WPSEO_URL . 'js/jquery.qtip.min.js', array( 'jquery' ), '1.0.0-RC3', true );
wp_enqueue_script( 'wp-seo-metabox', WPSEO_URL . 'js/wp-seo-metabox.js', array( 'jquery', 'jquery-ui-core', 'jquery-ui-autocomplete' ), WPSEO_VERSION, true );
// Text strings to pass to metabox for keyword analysis
wp_localize_script( 'wp-seo-metabox', 'objectL10n', array(
'keyword_header' => __( 'Your focus keyword was found in:', 'wordpress-seo' ),
'article_header_text' => __( 'Article Heading: ', 'wordpress-seo' ),
'page_title_text' => __( 'Page title: ', 'wordpress-seo' ),
'page_url_text' => __( 'Page URL: ', 'wordpress-seo' ),
'content_text' => __( 'Content: ', 'wordpress-seo' ),
'meta_description_text' => __( 'Meta description: ', 'wordpress-seo' ),
) );
}
}
@@ -772,7 +794,7 @@ class WPSEO_Metabox {
return false;
echo '<select name="seo_filter">';
echo '<option value="">All SEO Scores</option>';
echo '<option value="">' . __( "All SEO Scores", 'wordpress-seo' ) . '</option>';
foreach ( array(
'na' => __( 'SEO: No Focus Keyword', 'wordpress-seo' ),
'bad' => __( 'SEO: Bad', 'wordpress-seo' ),
@@ -814,7 +836,7 @@ class WPSEO_Metabox {
wpseo_set_value( 'linkdex', 0, $post_id );
} else if ( $score = wpseo_get_value( 'linkdex', $post_id ) ) {
$score = wpseo_translate_score( round( $score / 10 ) );
$title = $score;
$title = wpseo_translate_score( round( $score / 10 ), $css = false );
} else {
$this->calculate_results( get_post( $post_id ) );
$score = wpseo_get_value( 'linkdex', $post_id );
@@ -823,11 +845,11 @@ class WPSEO_Metabox {
$title = __( 'Focus keyword not set.', 'wordpress-seo' );
} else {
$score = wpseo_translate_score( $score );
$title = $score;
$title = wpseo_translate_score( $score, $css = false );
}
}
echo '<div title="' . $title . '" alt="' . $title . '" class="wpseo_score_img ' . esc_attr( $score ) . '"></div>';
echo '<div title="' . esc_attr( $title ) . '" alt="' . esc_attr( $title ) . '" class="wpseo_score_img ' . esc_attr( $score ) . '"></div>';
}
if ( $column_name == 'wpseo-title' ) {
echo esc_html( apply_filters( 'wpseo_title', $this->page_title( $post_id ) ) );
@@ -973,10 +995,13 @@ class WPSEO_Metabox {
} else {
$post = get_post( $post_id );
$options = get_wpseo_options();
if ( isset( $options['title-' . $post->post_type] ) && !empty( $options['title-' . $post->post_type] ) )
return wpseo_replace_vars( $options['title-' . $post->post_type], (array) $post );
else
if ( isset( $options['title-' . $post->post_type] ) && !empty( $options['title-' . $post->post_type] ) ) {
$title_template = $options['title-' . $post->post_type];
$title_template = str_replace( ' %%page%% ', ' ', $title_template);
return wpseo_replace_vars( $title_template, (array) $post );
} else {
return wpseo_replace_vars( '%%title%%', (array) $post );
}
}
}
@@ -1054,7 +1079,12 @@ class WPSEO_Metabox {
wpseo_set_value( 'linkdex', 0, $post->ID );
return $result;
}
} elseif ( apply_filters( 'wpseo_use_page_analysis', true ) !== true ) {
$result = new WP_Error( 'page-analysis-disabled', sprintf( __( 'Page Analysis has been disabled.', 'wordpress-seo' ), $post->post_type ) );
return $result;
}
$results = array();
$job = array();
@@ -1227,13 +1257,13 @@ class WPSEO_Metabox {
'numberposts' => -1
)
);
if ( count( $posts ) == 0 )
$this->save_score_result( $results, 9, __( "You've never used this focus keyword before, very good." ), 'keyword_overused' );
$this->save_score_result( $results, 9, __( "You've never used this focus keyword before, very good.", 'wordpress-seo' ), 'keyword_overused' );
else if ( count( $posts ) == 1 )
$this->save_score_result( $results, 6, sprintf( __( 'You\'ve used this focus keyword %1$sonce before%2$s, be sure to make very clear which URL on your site is the most important for this keyword.' ), '<a href="' . admin_url( 'post.php?post=' . $posts[0] . '&action=edit' ) . '">', '</a>' ), 'keyword_overused' );
$this->save_score_result( $results, 6, sprintf( __( 'You\'ve used this focus keyword %1$sonce before%2$s, be sure to make very clear which URL on your site is the most important for this keyword.', 'wordpress-seo' ), '<a href="' . admin_url( 'post.php?post=' . $posts[0] . '&action=edit' ) . '">', '</a>' ), 'keyword_overused' );
else
$this->save_score_result( $results, 1, sprintf( __( 'You\'ve used this focus keyword %3$s%4$d times before%2$s, it\'s probably a good idea to read %1$sthis post on cornerstone content%2$s and improve your keyword strategy.' ), '<a href="http://yoast.com/cornerstone-content-rank/">', '</a>', '<a href="' . admin_url( 'edit.php?seo_kw_filter=' . urlencode( $job['keyword'] ) ) . '">', count( $posts ) ), 'keyword_overused' );
$this->save_score_result( $results, 1, sprintf( __( 'You\'ve used this focus keyword %3$s%4$d times before%2$s, it\'s probably a good idea to read %1$sthis post on cornerstone content%2$s and improve your keyword strategy.', 'wordpress-seo' ), '<a href="http://yoast.com/cornerstone-content-rank/">', '</a>', '<a href="' . admin_url( 'edit.php?seo_kw_filter=' . urlencode( $job['keyword'] ) ) . '">', count( $posts ) ), 'keyword_overused' );
}
/**
@@ -1655,9 +1685,9 @@ class WPSEO_Metabox {
}
$firstp = $this->strtolower_utf8( $firstp );
// First Paragraph Test
if ( stripos( $firstp, $job["keyword"] ) === false && stripos( $firstp, $job["keyword_folded"] ) === false ) {
if ( !preg_match('/\b'.$job["keyword"].'\b/', $firstp) && !preg_match('/\b'.$job["keyword_folded"].'\b/', $firstp) ) {
$this->save_score_result( $results, 3, $scoreFirstParagraphLow, 'keyword_first_paragraph' );
} else {
$this->save_score_result( $results, 9, $scoreFirstParagraphHigh, 'keyword_first_paragraph' );
@@ -1748,7 +1778,7 @@ class WPSEO_Metabox {
*/
function get_first_paragraph( $post ) {
// To determine the first paragraph we first need to autop the content, then match the first paragraph and return.
$res = preg_match( '/<p>(.*)<\/p>/', wpautop( $post->post_content ), $matches );
$res = preg_match( '/<p.*?>(.*)<\/p>/', wpautop( $post->post_content ), $matches );
if ( $res )
return $matches[1];
return false;
@@ -43,9 +43,11 @@ class WPSEO_Social_Admin extends WPSEO_Metabox {
/**
* Define the meta boxes for the Social tab
*
* @param string $post_type
*
* @return array Array containing the meta boxes
*/
public function get_meta_boxes() {
public function get_meta_boxes( $post_type = 'post' ) {
$mbs = array();
$mbs[ 'opengraph-description' ] = array(
"name" => "opengraph-description",
@@ -106,9 +106,9 @@ class WPSEO_Pointers {
),
'wpseo_social' => array(
'content' => "<h3>" . __( "Social settings", 'wordpress-seo' ) . "</h3>"
. "<p><strong>" . __( 'Facebook OpenGraph', 'wordpress-seo' ) . '</strong><br/>'
. __( "On this page you can enable the OpenGraph functionality from this plugin, as well as assign a Facebook user or Application to be the admin of your site, so you can view the Facebook insights.", 'wordpress-seo' ) . "</p>"
. '<p>' . sprintf( __( 'Read more about %1$sFacebook OpenGraph%2$s.', 'wordpress-seo' ), '<a target="_blank" href="http://yoast.com/facebook-open-graph-protocol/#utm_source=wpadmin&utm_medium=wpseo_tour&utm_term=link&utm_campaign=wpseoplugin">', '</a>' ) . "</p>"
. "<p><strong>" . __( 'Facebook Open Graph', 'wordpress-seo' ) . '</strong><br/>'
. __( "On this page you can enable the Open Graph functionality from this plugin, as well as assign a Facebook user or Application to be the admin of your site, so you can view the Facebook insights.", 'wordpress-seo' ) . "</p>"
. '<p>' . sprintf( __( 'Read more about %1$sFacebook Open Graph%2$s.', 'wordpress-seo' ), '<a target="_blank" href="http://yoast.com/facebook-open-graph-protocol/#utm_source=wpadmin&utm_medium=wpseo_tour&utm_term=link&utm_campaign=wpseoplugin">', '</a>' ) . "</p>"
. "<p><strong>" . __( 'Twitter Cards', 'wordpress-seo' ) . '</strong><br/>'
. sprintf( __( 'This functionality is currently in beta, but it allows for %1$sTwitter Cards%2$s.', 'wordpress-seo' ), '<a target="_blank" href="http://yoast.com/twitter-cards/#utm_source=wpadmin&utm_medium=wpseo_tour&utm_term=link&utm_campaign=wpseoplugin">', '</a>' ) . "</p>",
'button2' => __( 'Next', 'wordpress-seo' ),
@@ -171,9 +171,10 @@ class WPSEO_Pointers {
$function = 'document.location="' . admin_url( 'admin.php?page=wpseo_dashboard' ) . '";';
} else {
if ( '' != $page && in_array( $page, array_keys( $adminpages ) ) ) {
$align = ( is_rtl() ) ? 'right' : 'left';
$opt_arr = array(
'content' => $adminpages[$page]['content'],
'position' => array( 'edge' => 'top', 'align' => 'left' ),
'position' => array( 'edge' => 'top', 'align' => $align ),
'pointerWidth' => 400
);
$button2 = $adminpages[$page]['button2'];
@@ -188,11 +189,10 @@ class WPSEO_Pointers {
* Load a tiny bit of CSS in the head
*/
function admin_head() {
// Depreciated, marked for removal
// No longer needed as the original code is now being handle by an external CSS files that supports RTL
?>
<style type="text/css" media="screen">
#pointer-primary {
margin: 0 5px 0 0;
}
</style>
<?php
}
@@ -1,13 +1,14 @@
<?php
/**
*
*
* @package Admin
*/
if ( !defined('WPSEO_VERSION') ) {
header('HTTP/1.0 403 Forbidden');
if ( !defined( 'WPSEO_VERSION' ) ) {
header( 'HTTP/1.0 403 Forbidden' );
die;
}
global $wpseo_admin_pages;
$options = get_option( 'wpseo' );
@@ -28,6 +29,14 @@ if ( isset( $_GET['allow_tracking'] ) && check_admin_referer( 'wpseo_activate_tr
$wpseo_admin_pages->admin_header( __( 'General Settings', 'wordpress-seo' ), true, 'yoast_wpseo_options', 'wpseo' );
// detect and handle robots meta here
robots_meta_handler();
// detect and handle aioseo here
aioseo_handler();
do_action( 'wpseo_all_admin_notices' );
echo $wpseo_admin_pages->hidden( 'ignore_blog_public_warning' );
echo $wpseo_admin_pages->hidden( 'ignore_tour' );
echo $wpseo_admin_pages->hidden( 'ignore_page_comments' );
@@ -65,7 +74,7 @@ if ( isset( $_GET['fixmetadesc'] ) && check_admin_referer( 'wpseo-fix-metadesc',
if ( $header_file ) {
fwrite( $header_file, $fcontent );
fclose( $header_file );
$msg .= __( 'removed hardcoded meta description.' );
$msg .= __( 'Removed hardcoded meta description.', 'wordpress-seo' );
}
}
unset( $options['theme_check']['description_found'] );
@@ -118,7 +127,7 @@ if ( isset( $options['ignore_tour'] ) && $options['ignore_tour'] ) {
echo '<p class="desc label">' . __( 'Take this tour to quickly learn about the use of this plugin.', 'wordpress-seo' ) . '</p>';
}
echo '<label class="select">' . __( 'Default Settings:', 'wordpress-seo' ) . '</label><a class="button-secondary" href="' . admin_url( 'admin.php?page=wpseo_dashboard&wpseo_reset_defaults&nonce='. wp_create_nonce('wpseo_reset_defaults') ) . '">' . __( 'Reset Default Settings', 'wordpress-seo' ) . '</a>';
echo '<label class="select">' . __( 'Default Settings:', 'wordpress-seo' ) . '</label><a class="button-secondary" href="' . admin_url( 'admin.php?page=wpseo_dashboard&wpseo_reset_defaults&nonce='. wp_create_nonce( 'wpseo_reset_defaults' ) ) . '">' . __( 'Reset Default Settings', 'wordpress-seo' ) . '</a>';
echo '<p class="desc label">' . __( 'If you want to restore a site to the default WordPress SEO settings, press this button.', 'wordpress-seo' ) . '</p>';
echo '<h2>' . __( 'Tracking', 'wordpress-seo' ) . '</h2>';
@@ -137,4 +146,179 @@ echo $wpseo_admin_pages->textinput( 'alexaverify', '<a target="_blank" href="htt
do_action( 'wpseo_dashboard' );
$wpseo_admin_pages->admin_footer();
$wpseo_admin_pages->admin_footer();
/**
* Handle deactivation & import of Robots Meta data
*
* @ since 1.4.8
*/
function robots_meta_handler() {
global $wpdb;
// check if robots meta is running
if ( is_plugin_active( 'robots-meta/robots-meta.php' ) ) {
// deactivate robots meta
if ( isset( $_GET['deactivate_robots_meta'] ) && $_GET['deactivate_robots_meta'] == 1 ) {
deactivate_plugins( 'robots-meta/robots-meta.php' );
// show notice that robots meta has been deactivated
add_action( 'wpseo_all_admin_notices', 'wpseo_deactivate_robots_meta_notice' );
// import the settings
} else if ( isset( $_GET['import_robots_meta'] ) && $_GET['import_robots_meta'] == 1 ) {
// import robots meta setting for each post
$posts = $wpdb->get_results( "SELECT ID, robotsmeta FROM $wpdb->posts" );
foreach ( $posts as $post ) {
// sync all possible settings
if ( $post->robotsmeta ) {
$pieces = explode( ',', $post->robotsmeta );
foreach ( $pieces as $meta ) {
switch ( $meta ) {
case 'noindex':
wpseo_set_value( 'meta-robots-noindex', true, $post->ID );
break;
case 'index':
wpseo_set_value( 'meta-robots-noindex', 2, $post->ID );
break;
case 'nofollow':
wpseo_set_value( 'meta-robots-nofollow', true, $post->ID );
break;
case 'follow':
wpseo_set_value( 'meta-robots-nofollow', 0, $post->ID );
break;
default:
// do nothing
}
}
}
}
// show notice to deactivate robots meta plugin
add_action( 'wpseo_all_admin_notices', 'wpseo_deactivate_link_robots_meta_notice' );
// show notice to import robots meta settings
} else {
add_action( 'wpseo_all_admin_notices', 'wpseo_import_robots_meta_notice' );
}
}
}
/**
* Handle deactivation & import of AIOSEO data
*
* @ since 1.4.8
*/
function aioseo_handler() {
// check if aioseo is running
if ( is_plugin_active( 'all-in-one-seo-pack/all_in_one_seo_pack.php' ) ) {
// deactivate aioseo plugin
if ( isset( $_GET['deactivate_aioseo'] ) && $_GET['deactivate_aioseo'] == 1 ) {
deactivate_plugins( 'all-in-one-seo-pack/all_in_one_seo_pack.php' );
// show notice that aioseo has been deactivated
add_action( 'wpseo_all_admin_notices', 'wpseo_deactivate_aioseo_notice' );
// import the settings
// TODO: currently not deleting aioseop postmeta or handling old aioseop format
} else if ( isset( $_GET['import_aioseo'] ) && $_GET['import_aioseo'] == 1 ) {
$replace = false;
replace_meta( '_aioseop_description', '_yoast_wpseo_metadesc', $replace );
replace_meta( '_aioseop_keywords', '_yoast_wpseo_metakeywords', $replace );
replace_meta( '_aioseop_title', '_yoast_wpseo_title', $replace );
if ( isset( $_POST['wpseo']['importaioseoold'] ) ) {
replace_meta( 'description', '_yoast_wpseo_metadesc', $replace );
replace_meta( 'keywords', '_yoast_wpseo_metakeywords', $replace );
replace_meta( 'title', '_yoast_wpseo_title', $replace );
}
// show notice to deactivate aioseo plugin
add_action( 'wpseo_all_admin_notices', 'wpseo_deactivate_link_aioseo_notice' );
// show notice to import aioseo settings
} else {
add_action( 'wpseo_all_admin_notices', 'wpseo_import_aioseo_setting_notice' );
}
}
}
/**
* Throw a notice to import Robots Meta.
*
* @since 1.4.8
*/
function wpseo_import_robots_meta_notice() {
echo '<div class="updated"><p>' . sprintf( __( 'The plugin Robots-Meta has been detected. Do you want to %simport its settings%s.' ), '<a href="' . admin_url( 'admin.php?page=wpseo_dashboard&import_robots_meta=1' ) . '">', '</a>' ) . '</p></div>';
}
/**
* Throw a notice to allow the user to deactivate Robots Meta
*
* @since 1.4.8
*/
function wpseo_deactivate_link_robots_meta_notice() {
echo '<div class="updated"><p>' . sprintf( __( 'Robots-Meta settings has been imported. We recommend %sdisabling the Robots-Meta plugin%s to avoid any conflicts' ), '<a href="' . admin_url( 'admin.php?page=wpseo_dashboard&deactivate_robots_meta=1' ) . '">', '</a>' ) . '</p></div>';
}
/**
* Throw a notice to inform the user Robots Meta has been deactivated
*
* @since 1.4.8
*/
function wpseo_deactivate_robots_meta_notice() {
echo '<div class="updated"><p>' . __( 'Robots-Meta has been deactivated' ) . '</p></div>';
}
/**
* Throw a notice to import AIOSEO.
*
* @since 1.4.8
*/
function wpseo_import_aioseo_setting_notice() {
echo '<div class="updated"><p>' . sprintf( __( 'The plugin All-In-One-SEO has been detected. Do you want to %simport its settings%s.' ), '<a href="' . admin_url( 'admin.php?page=wpseo_dashboard&import_aioseo=1' ) . '">', '</a>' ) . '</p></div>';
}
/**
* Throw a notice to allow the user to deactivate AIOSEO
*
* @since 1.4.8
*/
function wpseo_deactivate_link_aioseo_notice( $active ) {
echo '<div class="updated"><p>' . sprintf( __( 'All in One SEO data successfully imported. Would you like to %sdisable the All in One SEO plugin%s.' ), '<a href="' . admin_url( 'admin.php?page=wpseo_dashboard&deactivate_aioseo=1' ) . '">', '</a>' ) . '</p></div>';
}
/**
* Throw a notice to inform the user AIOSEO has been deactivated
*
* @since 1.4.8
*/
function wpseo_deactivate_aioseo_notice() {
echo '<div class="updated"><p>' . __( 'All-In-One-SEO has been deactivated' ) . '</p></div>';
}
// TODO: consider moving this to a utility class. Currently being used in import.php also.
/**
* Used for imports, this functions either copies $old_metakey into $new_metakey or just plain replaces $old_metakey with $new_metakey
*
* @param string $old_metakey The old name of the meta value.
* @param string $new_metakey The new name of the meta value, usually the WP SEO name.
* @param bool $replace Whether to replace or to copy the values.
*/
function replace_meta( $old_metakey, $new_metakey, $replace = false ) {
global $wpdb;
$oldies = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $wpdb->postmeta WHERE meta_key = %s", $old_metakey ) );
foreach ( $oldies as $old ) {
// Prevent inserting new meta values for posts that already have a value for that new meta key
$check = get_post_meta( $old->post_id, $new_metakey, true );
if ( !$check || empty( $check ) )
update_post_meta( $old->post_id, $new_metakey, $old->meta_value );
if ( $replace )
delete_post_meta( $old->post_id, $old_metakey );
}
}
@@ -43,7 +43,7 @@ if ( isset( $_POST[ 'submithtaccess' ] ) ) {
}
}
$wpseo_admin_pages->admin_header( 'Files', false );
$wpseo_admin_pages->admin_header( __( 'Edit Files', 'wordpress-seo' ), false );
if ( isset( $msg ) && !empty( $msg ) ) {
echo '<div id="message" style="width:94%;" class="updated fade"><p>' . esc_html( $msg ) . '</p></div>';
}
@@ -253,7 +253,7 @@ if ( isset( $_POST['import'] ) ) {
$msg .= __( ', and meta keywords data deleted.', 'wordpress-seo' );
}
$wpseo_admin_pages->admin_header( 'Import', false );
$wpseo_admin_pages->admin_header( __( 'Import & Export', 'wordpress-seo' ), false );
if ( $msg != '' )
echo '<div id="message" class="message updated" style="width:94%;"><p>' . esc_html( $msg ) . '</p></div>';
@@ -267,12 +267,14 @@ $content .= $wpseo_admin_pages->checkbox( 'importaioseoold', __( 'Import from OL
$content .= $wpseo_admin_pages->checkbox( 'importwoo', __( 'Import from WooThemes SEO framework?', 'wordpress-seo' ) );
$content .= '<br/>';
$content .= $wpseo_admin_pages->checkbox( 'deleteolddata', __( 'Delete the old data after import? (recommended)', 'wordpress-seo' ) );
$content .= '<br/>';
$content .= '<input type="submit" class="button-primary" name="import" value="' . __( 'Import', 'wordpress-seo' ) . '" />';
$content .= '<br/><br/>';
$content .= '<h2>' . __( 'Import settings from other plugins', 'wordpress-seo' ) . '</h2>';
$content .= $wpseo_admin_pages->checkbox( 'importrobotsmeta', __( 'Import from Robots Meta (by Yoast)?', 'wordpress-seo' ) );
$content .= $wpseo_admin_pages->checkbox( 'importrssfooter', __( 'Import from RSS Footer (by Yoast)?', 'wordpress-seo' ) );
$content .= $wpseo_admin_pages->checkbox( 'importbreadcrumbs', __( 'Import from Yoast Breadcrumbs?', 'wordpress-seo' ) );
$content .= '<br/>';
$content .= '<input type="submit" class="button-primary" name="import" value="' . __( 'Import', 'wordpress-seo' ) . '" />';
$content .= '</form><br/>';
@@ -31,7 +31,7 @@ if ( ( isset( $_GET[ 'updated' ] ) && $_GET[ 'updated' ] == 'true' ) || ( isset(
<h2 id="wpseo-title"><?php _e( "Yoast WordPress SEO: Titles &amp; Metas", 'wordpress-seo' ); ?></h2>
<div id="wpseo_content_top" class="postbox-container">
<div class="metabox-holder">
<div class="metabox-holder" style="max-width: 650px; float: left;">
<div class="meta-box-sortables">
<h2 class="nav-tab-wrapper" id="wpseo-tabs">
@@ -88,12 +88,13 @@ if ( ( isset( $_GET[ 'updated' ] ) && $_GET[ 'updated' ] == 'true' ) || ( isset(
echo '<p>' . sprintf( __( 'You can determine the title and description for the blog page by %sediting the blog page itself &raquo;%s', 'wordpress-seo' ), '<a href="' . get_edit_post_link( get_option( 'page_for_posts' ) ) . '">', '</a>' ) . '</p>';
}
echo '<h2>' . __( 'Author metadata', 'wordpress-seo' ) . '</h2>';
echo '<label class="select" for="">' . __( 'Author highlighting', 'wordpress-seo' ) . ':</label>';
wp_dropdown_users( array( 'show_option_none' => "Don't show", 'name' => 'wpseo_titles[plus-author]', 'class' => 'select', 'selected' => isset( $options[ 'plus-author' ] ) ? $options[ 'plus-author' ] : '' ) );
echo '<p class="desc label">' . __( 'Choose the user that should be used for the <code>rel="author"</code> on the blog homepage. Make sure the user has filled out his/her Google+ profile link on their profile page.', 'wordpress-seo' ) . '</p>';
echo $wpseo_admin_pages->textinput( 'plus-publisher', __( 'Google Publisher Page', 'wordpress-seo' ) );
echo '<p class="desc label">' . __( 'If you have a Google+ page for your business, add that URL here and link it on your Google+ page\'s about page.', 'wordpress-seo' ) . '</p>';
// TODO: Please remove...Depreciated: moved over to the social tab
// echo '<h2>' . __( 'Author metadata', 'wordpress-seo' ) . '</h2>';
// echo '<label class="select" for="">' . __( 'Author highlighting', 'wordpress-seo' ) . ':</label>';
// wp_dropdown_users( array( 'show_option_none' => __( "Don't show", 'wordpress-seo' ), 'name' => 'wpseo_titles[plus-author]', 'class' => 'select', 'selected' => isset( $options[ 'plus-author' ] ) ? $options[ 'plus-author' ] : '' ) );
// echo '<p class="desc label">' . __( 'Choose the user that should be used for the <code>rel="author"</code> on the blog homepage. Make sure the user has filled out his/her Google+ profile link on their profile page.', 'wordpress-seo' ) . '</p>';
// echo $wpseo_admin_pages->textinput( 'plus-publisher-old', __( 'Google Publisher Page', 'wordpress-seo' ) );
// echo '<p class="desc label">' . __( 'If you have a Google+ page for your business, add that URL here and link it on your Google+ page\'s about page.', 'wordpress-seo' ) . '</p>';
?>
</div>
<div id="post_types" class="wpseotab">
@@ -108,6 +109,7 @@ if ( ( isset( $_GET[ 'updated' ] ) && $_GET[ 'updated' ] == 'true' ) || ( isset(
if ( isset( $options[ 'usemetakeywords' ] ) && $options[ 'usemetakeywords' ] )
echo $wpseo_admin_pages->textinput( 'metakey-' . $name, __( 'Meta keywords template', 'wordpress-seo' ) );
echo $wpseo_admin_pages->checkbox( 'noindex-' . $name, '<code>noindex, follow</code>', __( 'Meta Robots', 'wordpress-seo' ) );
echo $wpseo_admin_pages->checkbox( 'noauthorship-' . $name, __( 'Don\'t show <code>rel="author"</code>', 'wordpress-seo' ), __( 'Authorship', 'wordpress-seo' ) );
echo $wpseo_admin_pages->checkbox( 'showdate-' . $name, __( 'Show date in snippet preview?', 'wordpress-seo' ), __( 'Date in Snippet Preview', 'wordpress-seo' ) );
echo $wpseo_admin_pages->checkbox( 'hideeditbox-' . $name, __( 'Hide', 'wordpress-seo' ), __( 'WordPress SEO Meta Box', 'wordpress-seo' ) );
echo '<br/>';
@@ -322,6 +324,7 @@ if ( ( isset( $_GET[ 'updated' ] ) && $_GET[ 'updated' ] == 'true' ) || ( isset(
echo '<h2>' . __( 'Variables', 'wordpress-seo' ) . '</h2>';
echo $content;
?>
</div>
<?php
$wpseo_admin_pages->admin_footer();
$wpseo_admin_pages->admin_footer();
?>
</div>
@@ -11,7 +11,7 @@ if ( !defined('WPSEO_VERSION') ) {
global $wpseo_admin_pages;
$options = get_wpseo_options();
$wpseo_admin_pages->admin_header( 'RSS', true, 'yoast_wpseo_rss_options', 'wpseo_rss' );
$wpseo_admin_pages->admin_header( __( 'RSS', 'wordpress-seo' ), true, 'yoast_wpseo_rss_options', 'wpseo_rss' );
$content = '<p>' . __( "This feature is used to automatically add content to your RSS, more specifically, it's meant to add links back to your blog and your blog posts, so dumb scrapers will automatically add these links too, helping search engines identify you as the original source of the content.", 'wordpress-seo' ) . '</p>';
$rows = array();
@@ -135,25 +135,55 @@ $wpseo_admin_pages->admin_header( __( 'Social', 'wordpress-seo' ), true, 'yoast_
if ( $error )
settings_errors();
echo '<h2>' . __( 'Facebook OpenGraph', 'wordpress-seo' ) . '</h2>';
echo $wpseo_admin_pages->checkbox( 'opengraph', '<label for="opengraph">' . __( 'Add OpenGraph meta data', 'wordpress-seo' ) . '</label>' );
echo'<p class="desc">' . __( 'Add OpenGraph meta data to your site\'s <code>&lt;head&gt;</code> section. You can specify some of the ID\'s that are sometimes needed below:', 'wordpress-seo' ) . '</p>';
echo $fbconnect;
echo '<h4>' . __( 'Frontpage settings', 'wordpress-seo' ) . '</h4>';
echo $wpseo_admin_pages->textinput( 'og_frontpage_image', __( 'Image URL', 'wordpress-seo' ) );
echo $wpseo_admin_pages->textinput( 'og_frontpage_desc', __( 'Description', 'wordpress-seo' ) );
echo '<p class="desc label">' . __( 'These are the image and description used in the OpenGraph meta tags on the frontpage of your site.', 'wordpress-seo' ) . '</p>';
echo '<h4>' . __( 'Default settings', 'wordpress-seo' ) . '</h4>';
echo $wpseo_admin_pages->textinput( 'og_default_image', __( 'Image URL', 'wordpress-seo' ) );
echo '<p class="desc label">' . __( 'This image is used if the post/page being shared does not contain any images.', 'wordpress-seo' ) . '</p>';
?>
do_action('wpseo_admin_opengraph_section');
<h2 class="nav-tab-wrapper" id="wpseo-tabs">
<a class="nav-tab nav-tab-active" id="facebook-tab" href="#top#facebook"><?php _e( 'Facebook', 'wordpress-seo' );?></a>
<a class="nav-tab" id="twitter-tab" href="#top#twitter"><?php _e( 'Twitter', 'wordpress-seo' );?></a>
<a class="nav-tab" id="google-tab" href="#top#google"><?php _e( 'Google+', 'wordpress-seo' );?></a>
</h2>
echo '<h2>' . __( 'Twitter', 'wordpress-seo' ) . '</h2>';
echo $wpseo_admin_pages->checkbox( 'twitter', '<label for="twitter">' . __( 'Add Twitter card meta data', 'wordpress-seo' ) . '</label>' );
echo'<p class="desc">' . __( 'Add Twitter card meta data to your site\'s <code>&lt;head&gt;</code> section.', 'wordpress-seo' ) . '</p>';
echo $wpseo_admin_pages->textinput( 'twitter_site', __( 'Site Twitter Username', 'wordpress-seo' ) );
<div id="facebook" class="wpseotab">
<?php
echo '<p>';
echo $wpseo_admin_pages->checkbox( 'opengraph', '<label for="opengraph">' . __( 'Add Open Graph meta data', 'wordpress-seo' ) . '</label>' );
echo '</p>';
echo'<p class="desc">' . __( 'Add Open Graph meta data to your site\'s <code>&lt;head&gt;</code> section. You can specify some of the ID\'s that are sometimes needed below:', 'wordpress-seo' ) . '</p>';
echo $fbconnect;
echo $wpseo_admin_pages->textinput( 'facebook_site', __( 'Facebook Page URL', 'wordpress-seo' ) );
echo '<h4>' . __( 'Frontpage settings', 'wordpress-seo' ) . '</h4>';
echo $wpseo_admin_pages->textinput( 'og_frontpage_image', __( 'Image URL', 'wordpress-seo' ) );
echo $wpseo_admin_pages->textinput( 'og_frontpage_desc', __( 'Description', 'wordpress-seo' ) );
echo '<p class="desc label">' . __( 'These are the image and description used in the Open Graph meta tags on the frontpage of your site.', 'wordpress-seo' ) . '</p>';
echo '<h4>' . __( 'Default settings', 'wordpress-seo' ) . '</h4>';
echo $wpseo_admin_pages->textinput( 'og_default_image', __( 'Image URL', 'wordpress-seo' ) );
echo '<p class="desc label">' . __( 'This image is used if the post/page being shared does not contain any images.', 'wordpress-seo' ) . '</p>';
do_action('wpseo_admin_opengraph_section');
?>
</div>
do_action('wpseo_admin_twitter_section');
<div id="twitter" class="wpseotab">
<?php
echo '<p>';
echo $wpseo_admin_pages->checkbox( 'twitter', '<label for="twitter">' . __( 'Add Twitter card meta data', 'wordpress-seo' ) . '</label>' );
echo '</p>';
echo'<p class="desc">' . __( 'Add Twitter card meta data to your site\'s <code>&lt;head&gt;</code> section.', 'wordpress-seo' ) . '</p>';
echo $wpseo_admin_pages->textinput( 'twitter_site', __( 'Site Twitter Username', 'wordpress-seo' ) );
do_action('wpseo_admin_twitter_section');
?>
</div>
<div id="google" class="wpseotab">
<?php
// echo '<h2>' . __( 'Author metadata', 'wordpress-seo' ) . '</h2>';
echo '<label class="select" for="">' . __( 'Author for homepage', 'wordpress-seo' ) . ':</label>';
wp_dropdown_users( array( 'show_option_none' => __( "Don't show", 'wordpress-seo' ), 'name' => 'wpseo_social[plus-author]', 'class' => 'select', 'selected' => isset( $options[ 'plus-author' ] ) ? $options[ 'plus-author' ] : '' ) );
echo '<p class="desc label">' . __( 'Choose the user that should be used for the <code>rel="author"</code> on the blog homepage. Make sure the user has filled out his/her Google+ profile link on their profile page.', 'wordpress-seo' ) . '</p>';
echo $wpseo_admin_pages->textinput( 'plus-publisher', __( 'Google Publisher Page', 'wordpress-seo' ) );
echo '<p class="desc label">' . __( 'If you have a Google+ page for your business, add that URL here and link it on your Google+ page\'s about page.', 'wordpress-seo' ) . '</p>';
do_action('wpseo_admin_googleplus_section');
?>
</div>
<?php
$wpseo_admin_pages->admin_footer();
@@ -3,53 +3,60 @@
* @package Admin
*/
if ( !defined('WPSEO_VERSION') ) {
header('HTTP/1.0 403 Forbidden');
if ( !defined( 'WPSEO_VERSION' ) ) {
header( 'HTTP/1.0 403 Forbidden' );
die;
}
global $wpseo_admin_pages;
$wpseo_admin_pages->admin_header( 'XML Sitemaps', true, 'yoast_wpseo_xml_sitemap_options', 'wpseo_xml' );
$wpseo_admin_pages->admin_header( __( 'XML Sitemaps', 'wordpress-seo' ), true, 'yoast_wpseo_xml_sitemap_options', 'wpseo_xml' );
$options = get_option( 'wpseo_xml' );
$base = $GLOBALS[ 'wp_rewrite' ]->using_index_permalinks() ? 'index.php/' : '';
$base = $GLOBALS['wp_rewrite']->using_index_permalinks() ? 'index.php/' : '';
$content = $wpseo_admin_pages->checkbox( 'enablexmlsitemap', __( 'Check this box to enable XML sitemap functionality.', 'wordpress-seo' ), false );
$content .= '<div id="sitemapinfo">';
if ( isset($_SERVER['SERVER_SOFTWARE']) && stristr($_SERVER['SERVER_SOFTWARE'], 'nginx') !== false ) {
if ( isset( $_SERVER['SERVER_SOFTWARE'] ) && stristr( $_SERVER['SERVER_SOFTWARE'], 'nginx' ) !== false ) {
$content .= '<div style="margin: 5px 0; padding: 3px 10px; background-color: #ffffe0; border: 1px solid #E6DB55; border-radius: 3px">';
$content .= '<p>'.__('As you\'re on NGINX, you\'ll need the following rewrites:','wordpress-seo').'</p>';
$content .= '<p>' . __( 'As you\'re on NGINX, you\'ll need the following rewrites:', 'wordpress-seo' ) . '</p>';
$content .= '<pre>rewrite ^/sitemap_index\.xml$ /index.php?sitemap=1 last;
rewrite ^/([^/]+?)-sitemap([0-9]+)?\.xml$ /index.php?sitemap=$1&sitemap_n=$2 last;</pre>';
$content .= '</div>';
}
if ( isset( $options[ 'enablexmlsitemap' ] ) && $options[ 'enablexmlsitemap' ] )
if ( isset( $options['enablexmlsitemap'] ) && $options['enablexmlsitemap'] )
$content .= '<p>' . sprintf( __( 'You can find your XML Sitemap here: %sXML Sitemap%s', 'wordpress-seo' ), '<a target="_blank" class="button-secondary" href="' . home_url( $base . 'sitemap_index.xml' ) . '">', '</a>' ) . '<br/><br/>' . __( 'You do <strong>not</strong> need to generate the XML sitemap, nor will it take up time to generate after publishing a post.', 'wordpress-seo' ) . '</p>';
else
$content .= '<p>' . __( 'Save your settings to activate XML Sitemaps.', 'wordpress-seo' ) . '</p>';
$content .= '<strong>' . __( 'General settings', 'wordpress-seo' ) . '</strong><br/>';
$content .= '<h2>' . __( 'User sitemap', 'wordpress-seo' ) . '</h2>';
$content .= $wpseo_admin_pages->checkbox( 'disable_author_sitemap', __( "Disable author/user sitemap", 'wordpress-seo' ), false );
$content .= '<br/>';
$content .= '<h2>' . __( 'General settings', 'wordpress-seo' ) . '</h2>';
$content .= '<p>' . __( 'After content publication, the plugin automatically pings Google and Bing, do you need it to ping other search engines too? If so, check the box:', 'wordpress-seo' ) . '</p>';
$content .= $wpseo_admin_pages->checkbox( 'xml_ping_yahoo', __( "Ping Yahoo!", 'wordpress-seo' ), false );
$content .= $wpseo_admin_pages->checkbox( 'xml_ping_ask', __( "Ping Ask.com", 'wordpress-seo' ), false );
$content .= '<br/><strong>' . __( 'Exclude post types', 'wordpress-seo' ) . '</strong><br/>';
$content .= '<h2>' . __( 'Exclude post types', 'wordpress-seo' ) . '</h2>';
$content .= '<p>' . __( 'Please check the appropriate box below if there\'s a post type that you do <strong>NOT</strong> want to include in your sitemap:', 'wordpress-seo' ) . '</p>';
foreach ( get_post_types( array( 'public' => true ), 'objects' ) as $pt ) {
$post_types = apply_filters( 'wpseo_sitemaps_supported_post_types', get_post_types( array( 'public' => true ), 'objects' ) );
foreach ( $post_types as $pt ) {
$content .= $wpseo_admin_pages->checkbox( 'post_types-' . $pt->name . '-not_in_sitemap', $pt->labels->name . ' (<code>' . $pt->name . '</code>)' );
}
$content .= '<br/>';
$content .= '<strong>' . __( 'Exclude taxonomies', 'wordpress-seo' ) . '</strong><br/>';
$content .= '<h2>' . __( 'Exclude taxonomies', 'wordpress-seo' ) . '</h2>';
$content .= '<p>' . __( 'Please check the appropriate box below if there\'s a taxonomy that you do <strong>NOT</strong> want to include in your sitemap:', 'wordpress-seo' ) . '</p>';
foreach ( get_taxonomies( array( 'public' => true ), 'objects' ) as $tax ) {
$taxonomies = apply_filters( 'wpseo_sitemaps_supported_taxonomies', get_taxonomies( array( 'public' => true ), 'objects' ) );
foreach ( $taxonomies as $tax ) {
if ( isset( $tax->labels->name ) && trim( $tax->labels->name ) != '' )
$content .= $wpseo_admin_pages->checkbox( 'taxonomies-' . $tax->name . '-not_in_sitemap', $tax->labels->name . ' (<code>' . $tax->name . '</code>)' );
}
$content .= '<br/>';
$content .= '<strong>' . __( 'Entries per page', 'wordpress-seo' ) . '</strong><br/>';
$content .= '<h2>' . __( 'Entries per page', 'wordpress-seo' ) . '</h2>';
$content .= '<p>' . __( 'Please enter the maximum number of entries per sitemap page (defaults to 1000, you might want to lower this to prevent memory issues on some installs):', 'wordpress-seo' ) . '</p>';
$content .= $wpseo_admin_pages->textinput( 'entries-per-page', __( 'Max entries per sitemap page', 'wordpress-seo' ) );
@@ -283,6 +283,7 @@ table.wpseoanalysis td.score {
background-image: url(../images/score_buttons.png);
background-repeat: no-repeat;
padding: 0 0 0 0;
vertical-align: bottom;
}
.wpseo_score_img.good {
background-position: -2px -2px;
@@ -0,0 +1,70 @@
/**
* RTL support
*/
p.desc {
padding: 0 22px 8px 0;
}
p.desc.label {
padding: 2px 180px 10px 0;
}
div.yoastbox ul {
margin-right: 20px;
margin-left: auto;
}
.postbox {
margin: 10px 0 0 10px;
}
label {
float: right;
margin-right: 6px;
margin-left: auto;
}
input.textinput, textarea.textinput, select.select, input.checkbox {
float: right;
margin: 12px 0 0 3px;
}
label.radio {
margin-left: 20px;
margin-left: auto;
}
table.yoast_help th, table.yoast_help td {
text-align: right;
}
.button.fixit {
float: left;
}
pre {
direction: ltr;
}
#pointer-primary {
margin: 0 0 0 5px;
}
.wpseo-heading {
padding-left: 0;
padding-right: 10px;
}
.wpseo_yahoo_kw {
margin: 3px 0 3px 8px;
}
table.wpseoanalysis th {
text-align: right;
}
table.wpseoanalysis td.score {
padding-left: 0;
padding-right: 10px;
}
@@ -201,4 +201,8 @@ h2 code {
#wpseo-conf {
max-width: 600px;
}
#pointer-primary {
margin: 0 5px 0 0;
}
@@ -739,13 +739,11 @@ class WPSEO_Frontend {
}
/**
* Output the rel=publisher code on the frontpage of the site.
* Output the rel=publisher code on every page of the site.
*/
public function publisher() {
if ( is_front_page() ) {
if ( isset( $this->options['plus-publisher'] ) && !empty( $this->options['plus-publisher'] ) )
echo '<link rel="publisher" href="' . esc_attr( $this->options['plus-publisher'] ) . '"/>' . "\n";
}
if ( isset( $this->options['plus-publisher'] ) && !empty( $this->options['plus-publisher'] ) )
echo '<link rel="publisher" href="' . esc_attr( $this->options['plus-publisher'] ) . '"/>' . "\n";
}
/**
@@ -757,6 +755,12 @@ class WPSEO_Frontend {
if ( is_singular() ) {
global $post;
$gplus = get_the_author_meta( 'googleplus', $post->post_author );
// unset gplus when authorship is disabled for this post type
if ( isset( $this->options['noauthorship-' . $post->post_type] ) && $this->options['noauthorship-' . $post->post_type] ) {
$gplus = false;
}
} else if ( is_home() ) {
if ( isset( $this->options['plus-author'] ) )
$gplus = get_the_author_meta( 'googleplus', $this->options['plus-author'] );
@@ -43,6 +43,9 @@ class WPSEO_OpenGraph extends WPSEO_Frontend {
add_action( 'wpseo_opengraph', array( $this, 'description'), 11 );
add_action( 'wpseo_opengraph', array( $this, 'url'), 12 );
add_action( 'wpseo_opengraph', array( $this, 'site_name'), 13 );
add_action( 'wpseo_opengraph', array( $this, 'article_author_facebook'), 14 );
add_action( 'wpseo_opengraph', array( $this, 'website_facebook'), 15 );
add_action( 'wpseo_opengraph', array( $this, 'type'), 5 );
add_action( 'wpseo_opengraph', array( $this, 'image'), 30 );
}
@@ -54,6 +57,7 @@ class WPSEO_OpenGraph extends WPSEO_Frontend {
* Main OpenGraph output.
*/
public function opengraph() {
wp_reset_query();
do_action( 'wpseo_opengraph' );
}
@@ -88,6 +92,32 @@ class WPSEO_OpenGraph extends WPSEO_Frontend {
return $input . ' prefix="og: http://ogp.me/ns#' . ( ( isset( $this->options['fbadminapp'] ) || isset( $this->options['fb_admins'] ) ) ? ' fb: http://ogp.me/ns/fb#' : '' ) . '"';
}
/**
* Outputs the authors FB page.
*
* @link https://developers.facebook.com/blog/post/2013/06/19/platform-updates--new-open-graph-tags-for-media-publishers-and-more/
*/
public function article_author_facebook() {
if ( !is_singular() )
return;
global $post;
$facebook = get_the_author_meta( 'facebook', $post->post_author );
if ( $facebook && !empty( $facebook ) )
echo "<meta property='article:author' content='" . esc_attr( $facebook ) . "'/>\n";
}
/**
* Outputs the websites FB page.
*
* @link https://developers.facebook.com/blog/post/2013/06/19/platform-updates--new-open-graph-tags-for-media-publishers-and-more/
*/
public function website_facebook() {
if ( isset( $this->options['facebook_site'] ) && $this->options['facebook_site'] )
echo "<meta property='article:publisher' content='" . esc_attr( $this->options['facebook_site'] ) . "'/>\n";
}
/**
* Outputs the site owner
*/
@@ -242,14 +272,15 @@ class WPSEO_OpenGraph extends WPSEO_Frontend {
* @return bool
*/
public function image() {
global $post;
if ( is_front_page() ) {
if ( isset( $this->options['og_frontpage_image'] ) )
$this->image_output( $this->options['og_frontpage_image'] );
}
if ( is_singular() ) {
global $post;
if ( is_front_page() ) {
if ( isset( $this->options['og_frontpage_image'] ) )
$this->image_output( $this->options['og_frontpage_image'] );
}
if ( function_exists( 'has_post_thumbnail' ) && has_post_thumbnail( $post->ID ) ) {
$thumb = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), apply_filters( 'wpseo_opengraph_image_size', 'large' ) );
$this->image_output( $thumb[0] );
@@ -276,10 +307,22 @@ class WPSEO_OpenGraph extends WPSEO_Frontend {
* @return string $ogdesc
*/
public function description( $echo = true ) {
$ogdesc = wpseo_get_value( 'opengraph-description' );
$ogdesc = '';
if ( is_front_page() ) {
if ( isset( $this->options['og_frontpage_desc'] ) )
$ogdesc = $this->options['og_frontpage_desc'];
}
if ( !$ogdesc )
$ogdesc = $this->metadesc( false );
if ( is_singular() ) {
$ogdesc = wpseo_get_value( 'opengraph-description' );
if ( !$ogdesc )
$ogdesc = $this->metadesc( false );
// og:description is still blank so grab it from get_the_excerpt()
if ( !$ogdesc )
$ogdesc = strip_tags( get_the_excerpt() );
}
$ogdesc = apply_filters( 'wpseo_opengraph_desc', $ogdesc );
@@ -40,15 +40,15 @@ class WPSEO_Twitter extends WPSEO_Frontend {
$this->type();
$this->site_twitter();
$this->site_domain();
$this->author_twitter();
// No need to show these when OpenGraph is also showing, as it'd be the same contents and Twitter
// would fallback to OpenGraph anyway.
$this->image();
$options = get_wpseo_options();
$this->twitter_description();
if ( !isset( $options['opengraph'] ) || !$options['opengraph'] ) {
$this->twitter_description();
$this->twitter_title();
$this->twitter_url();
}
@@ -70,17 +70,27 @@ class WPSEO_Twitter extends WPSEO_Frontend {
*/
public function site_twitter() {
if ( isset( $this->options['twitter_site'] ) )
echo '<meta name="twitter:site" content="@' . trim( $this->options['twitter_site'] ) . '"/>' . "\n";
echo '<meta name="twitter:site" content="@' . apply_filters( 'wpseo_twitter_site', ltrim( trim( $this->options['twitter_site'] ), '@' ) ) . '"/>' . "\n";
}
/**
* Displays the domain tag for the site.
*/
public function site_domain() {
echo '<meta name="twitter:domain" content="' . apply_filters( 'wpseo_twitter_domain', get_bloginfo( 'name' ) ) . '"/>' . "\n";
}
/**
* Displays the authors Twitter account.
*/
public function author_twitter() {
$twitter = trim( get_the_author_meta( 'twitter' ) );
$twitter = ltrim( trim( get_the_author_meta( 'twitter' ) ), '@' );
if ( $twitter && !empty( $twitter ) )
echo '<meta name="twitter:creator" content="@' . $twitter . '"/>' . "\n";
echo '<meta name="twitter:creator" content="@' . apply_filters( 'wpseo_twitter_creator_account', $twitter ) . '"/>' . "\n";
else if ( isset( $this->options['twitter_site'] ) )
echo '<meta name="twitter:creator" content="@' . apply_filters( 'wpseo_twitter_creator_account', ltrim( trim( $this->options['twitter_site'] ), '@' ) ) . '"/>' . "\n";
}
/**
@@ -89,7 +99,7 @@ class WPSEO_Twitter extends WPSEO_Frontend {
* Only used when OpenGraph is inactive.
*/
public function twitter_title() {
echo '<meta name="twitter:title" content="' . $this->title( '' ) . '"/>' . "\n";
echo '<meta name="twitter:title" content="' . apply_filters( 'wpseo_twitter_title', $this->title( '' ) ) . '"/>' . "\n";
}
/**
@@ -101,14 +111,14 @@ class WPSEO_Twitter extends WPSEO_Frontend {
$metadesc = trim( $this->metadesc( false ) );
if ( empty( $metadesc ) )
$metadesc = false;
if ( $metadesc && isset( $options['opengraph'] ) && $options['opengraph'] ) {
if ( $metadesc && isset( $this->options['opengraph'] ) && $this->options['opengraph'] ) {
// Already output the same description in opengraph, no need to repeat.
return;
} else if ( !$metadesc ) {
$metadesc = strip_tags( get_the_excerpt() );
}
echo '<meta name="twitter:description" content="' . esc_attr( $metadesc ) . '"/>' . "\n";
echo '<meta name="twitter:description" content="' . apply_filters( 'wpseo_twitter_description', esc_attr( $metadesc ) ) . '"/>' . "\n";
}
/**
@@ -127,21 +137,78 @@ class WPSEO_Twitter extends WPSEO_Frontend {
*/
public function image() {
global $post;
if ( function_exists( 'has_post_thumbnail' ) && has_post_thumbnail( $post->ID ) ) {
$featured_img = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), apply_filters( 'wpseo_opengraph_image_size', 'medium' ) );
if ( $featured_img ) {
$img = apply_filters( 'wpseo_opengraph_image', $featured_img[0] );
echo "<meta name='twitter:image' content='" . esc_attr( $img ) . "'/>\n";
$shown_images = array();
if ( is_singular() ) {
if ( is_front_page() ) {
if ( isset( $this->options['og_frontpage_image'] ) ) {
$escaped_img = esc_attr( $this->options['og_frontpage_image'] );
if ( ! empty( $escaped_img ) ) {
echo '<meta name="twitter:image:src" content="' . $escaped_img . '"/>' . "\n";
// No images yet, don't test
array_push( $shown_images, $escaped_img );
}
}
}
} else {
$options = get_wpseo_options();
if ( isset( $options['og_frontpage_image'] ) && !empty( $options['og_frontpage_image'] ) )
echo "<meta name='twitter:image' content='" . esc_attr( $options['og_frontpage_image'] ) . "'/>\n";
if ( function_exists( 'has_post_thumbnail' ) && has_post_thumbnail( $post->ID ) ) {
$featured_img = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), apply_filters( 'wpseo_opengraph_image_size', 'medium' ) );
if ( $featured_img ) {
$escaped_img = esc_attr( apply_filters( 'wpseo_opengraph_image', $featured_img[0] ) );
if ( ! empty( $escaped_img ) && ! in_array( $escaped_img, $shown_images ) ) {
echo '<meta name="twitter:image:src" content="' . $escaped_img . '"/>' . "\n";
array_push( $shown_images, $escaped_img );
}
}
}
if ( preg_match_all( '/<img [^>]+>/', $post->post_content, $matches ) ) {
foreach ( $matches[0] as $img ) {
if ( preg_match( '/src=("|\')(.*?)\1/', $img, $match ) ) {
$escaped_match = esc_attr( $match[2] );
if ( ! empty( $escaped_match ) && ! in_array( $escaped_match, $shown_images ) ) {
echo '<meta name="twitter:image:src" content="' . $escaped_match . '"/>' . "\n";
array_push( $shown_images, $escaped_match );
}
}
}
}
}
if ( count( $shown_images ) == 0 && isset( $this->options['og_default_image'] ) )
echo '<meta name="twitter:image:src" content="' . esc_attr( $this->options['og_default_image'] ) . '"/>' . "\n";
}
}
global $wpseo_twitter;
Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 710 B

@@ -0,0 +1,81 @@
<?php
/**
* @package ?
*/
if ( !defined( 'WPSEO_VERSION' ) ) {
header( 'HTTP/1.0 403 Forbidden' );
die;
}
/**
* This is a custom walker that is used to create tree lists for
* custom post types and taxonomy
*/
class Sitemap_Walker extends Walker_Category {
/**
* Record of posts added to tree
*/
private $processed_post_ids = array();
/**
* Code that appends posts when a child node is reached
*/
function end_el(&$output, $object, $depth = 0, $args = array()) {
$tax_name = $args['taxonomy'];
// use cat_id for category and slug for all other taxonomy
$term_id = ($tax_name == 'category') ? $object->cat_ID : $object->slug;
$query_args = array(
'post_type' => $args['post_type'],
'post_status' => 'publish',
'posts_per_page' => -1,
"{$tax_name}" => $term_id,
'meta_query' => array(
'relation' => 'OR',
// include if this key doesn't exists
array(
'key' => '_yoast_wpseo_meta-robots-noindex',
'value' => '', // This is ignored, but is necessary...
'compare' => 'NOT EXISTS'
),
// OR if key does exists include if it is not 1
array(
'key' => '_yoast_wpseo_meta-robots-noindex',
'value' => '1',
'compare' => '!='
),
// OR this key overrides it
array(
'key' => '_yoast_wpseo_sitemap-html-include',
'value' => 'always',
'compare' => '='
)
)
);
$posts = get_posts( $query_args );
$output .= "<ul>";
foreach ( $posts as $post ) {
$category = get_the_terms( $post->ID, $tax_name );
if ( $category ) {
// reset array to get the first element
$category = reset( $category );
// Only display a post link once, even if it's in multiple taxonomies
if ( $category->term_id == $object->term_id && !in_array( $post->ID, $this->processed_post_ids ) ) {
$this->processed_post_ids[] = $post->ID;
$output .= '<li><a href="'.get_permalink($post->ID).'">'.get_the_title($post->ID).'</a></li>';
}
}
}
$output .= "</ul>";
parent::end_el($output, $object, $depth, $args);
}
}
@@ -8,6 +8,9 @@ if ( !defined( 'WPSEO_VERSION' ) ) {
die;
}
/**
* Class WPSEO_Sitemaps
*/
class WPSEO_Sitemaps {
/**
* Content of the sitemap to output.
@@ -29,6 +32,11 @@ class WPSEO_Sitemaps {
*/
private $max_entries = 1000;
/**
* Holds the WP SEO
*/
private $options = array();
function __construct() {
if ( !defined( 'ENT_XML1' ) )
define( "ENT_XML1", 16 );
@@ -40,6 +48,8 @@ class WPSEO_Sitemaps {
// default stylesheet
$this->stylesheet = '<?xml-stylesheet type="text/xsl" href="' . WPSEO_FRONT_URL . 'css/xml-sitemap-xsl.php"?>';
$this->options = get_wpseo_options();
}
/**
@@ -91,8 +101,7 @@ class WPSEO_Sitemaps {
$GLOBALS['wp']->add_query_var( 'sitemap' );
$GLOBALS['wp']->add_query_var( 'sitemap_n' );
$options = get_wpseo_options();
$this->max_entries = ( isset( $options['entries-per-page'] ) && $options['entries-per-page'] != '' ) ? intval( $options['entries-per-page'] ) : 1000;
$this->max_entries = ( isset( $this->options['entries-per-page'] ) && $this->options['entries-per-page'] != '' ) ? intval( $this->options['entries-per-page'] ) : 1000;
add_rewrite_rule( 'sitemap_index\.xml$', 'index.php?sitemap=1', 'top' );
add_rewrite_rule( '([^/]+?)-sitemap([0-9]+)?\.xml$', 'index.php?sitemap=$matches[1]&sitemap_n=$matches[2]', 'top' );
@@ -113,10 +122,6 @@ class WPSEO_Sitemaps {
return;
}
// $wphost = parse_url( get_site_url(), PHP_URL_HOST );
// if ( isset( $_SERVER['SERVER_NAME'] ) && $_SERVER['SERVER_NAME'] != $wphost ) {
// wp_redirect( rtrim( get_site_url(), '/' ) . $_SERVER['REQUEST_URI'], 301 );
// }
$this->output();
die();
}
@@ -128,6 +133,9 @@ class WPSEO_Sitemaps {
* @param string $type The requested sitemap's identifier.
*/
function build_sitemap( $type ) {
if ( !is_admin() )
@ob_clean();
$type = apply_filters( 'wpseo_build_sitemap_post_type', $type );
if ( $type == 1 )
@@ -136,7 +144,9 @@ class WPSEO_Sitemaps {
$this->build_post_type_map( $type );
else if ( $tax = get_taxonomy( $type ) )
$this->build_tax_map( $tax );
else if ( has_action( 'wpseo_do_sitemap_' . $type ) )
else if ( $type == 'author' ) {
$this->build_user_map();
} else if ( has_action( 'wpseo_do_sitemap_' . $type ) )
do_action( 'wpseo_do_sitemap_' . $type );
else
$this->bad_sitemap = true;
@@ -150,16 +160,19 @@ class WPSEO_Sitemaps {
*/
function build_root_map() {
global $wpdb;
if ( !is_admin() )
@ob_clean();
$options = get_wpseo_options();
global $wpdb;
$this->sitemap = '<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">' . "\n";
$base = $GLOBALS['wp_rewrite']->using_index_permalinks() ? 'index.php/' : '';
// reference post type specific sitemaps
foreach ( get_post_types( array( 'public' => true ) ) as $post_type ) {
if ( isset( $options['post_types-' . $post_type . '-not_in_sitemap'] ) && $options['post_types-' . $post_type . '-not_in_sitemap'] )
if ( isset( $this->options['post_types-' . $post_type . '-not_in_sitemap'] ) && $this->options['post_types-' . $post_type . '-not_in_sitemap'] )
continue;
else if ( apply_filters( 'wpseo_sitemap_exclude_post_type', false, $post_type ) )
continue;
$query = $wpdb->prepare( "SELECT COUNT(ID) FROM $wpdb->posts WHERE post_type = '%s' AND post_status IN ('publish','inherit')", $post_type );
@@ -177,9 +190,10 @@ class WPSEO_Sitemaps {
$date = $this->get_last_modified( $post_type );
} else {
$date = $wpdb->get_var( $wpdb->prepare( "SELECT post_modified_gmt FROM $wpdb->posts WHERE post_status IN ('publish','inherit') AND post_type = %s ORDER BY post_modified_gmt ASC LIMIT 1 OFFSET %d", $post_type, $this->max_entries * ( $i + 1 ) - 1 ) );
$date = date( 'c', strtotime( $date ) );
}
$date = date( 'c', strtotime( $date ) );
$this->sitemap .= '<sitemap>' . "\n";
$this->sitemap .= '<loc>' . home_url( $base . $post_type . '-sitemap' . $count . '.xml' ) . '</loc>' . "\n";
$this->sitemap .= '<lastmod>' . htmlspecialchars( $date ) . '</lastmod>' . "\n";
@@ -191,21 +205,106 @@ class WPSEO_Sitemaps {
foreach ( get_taxonomies( array( 'public' => true ) ) as $tax ) {
if ( in_array( $tax, array( 'link_category', 'nav_menu', 'post_format' ) ) )
continue;
else if ( apply_filters( 'wpseo_sitemap_exclude_taxonomy', false, $tax ) )
continue;
if ( isset( $options['taxonomies-' . $tax . '-not_in_sitemap'] ) && $options['taxonomies-' . $tax . '-not_in_sitemap'] )
if ( isset( $this->options['taxonomies-' . $tax . '-not_in_sitemap'] ) && $this->options['taxonomies-' . $tax . '-not_in_sitemap'] )
continue;
// don't include taxonomies with no terms
if ( !$wpdb->get_var( $wpdb->prepare( "SELECT term_id FROM $wpdb->term_taxonomy WHERE taxonomy = %s AND count != 0 LIMIT 1", $tax ) ) )
continue;
// Retrieve the post_types that are registered to this taxonomy and then retrieve last modified date for all of those combined.
$taxobj = get_taxonomy( $tax );
$date = $this->get_last_modified( $taxobj->object_type );
$steps = $this->max_entries;
$all_terms = get_terms( $tax, array( 'hide_empty' => true, 'fields' => 'names' ) );
$count = count( $all_terms );
$n = ( $count > $this->max_entries ) ? (int) ceil( $count / $this->max_entries ) : 1;
$this->sitemap .= '<sitemap>' . "\n";
$this->sitemap .= '<loc>' . home_url( $base . $tax . '-sitemap.xml' ) . '</loc>' . "\n";
$this->sitemap .= '<lastmod>' . htmlspecialchars( $date ) . '</lastmod>' . "\n";
$this->sitemap .= '</sitemap>' . "\n";
for ( $i = 0; $i < $n; $i++ ) {
$count = ( $n > 1 ) ? $i + 1 : '';
$taxobj = get_taxonomy( $tax );
if ( ( empty( $count ) || $count == $n ) && false ) {
$date = $this->get_last_modified( $post_type );
} else {
$terms = array_splice( $all_terms, 0, $steps );
if ( !$terms )
continue;
$args = array(
'post_type' => $taxobj->object_type,
'tax_query' => array(
array(
'taxonomy' => $tax,
'field' => 'slug',
'terms' => $terms
)
),
'orderby' => 'modified',
'order' => 'DESC',
);
$query = new WP_Query( $args );
$date = '';
if ( $query->have_posts() )
$date = $query->posts[0]->post_modified_gmt;
}
// Retrieve the post_types that are registered to this taxonomy and then retrieve last modified date for all of those combined.
// $taxobj = get_taxonomy( $tax );
// $date = $this->get_last_modified( $taxobj->object_type );
$date = date( 'c', strtotime( $date ) );
$this->sitemap .= '<sitemap>' . "\n";
$this->sitemap .= '<loc>' . home_url( $base . $tax . '-sitemap' . $count . '.xml' ) . '</loc>' . "\n";
$this->sitemap .= '<lastmod>' . htmlspecialchars( $date ) . '</lastmod>' . "\n";
$this->sitemap .= '</sitemap>' . "\n";
}
}
if ( !isset( $this->options['disable-author'] ) && !isset( $this->options['disable_author_sitemap'] ) ) {
// reference user profile specific sitemaps
$users = get_users( array( 'who' => 'authors' ) );
$count = count( $users );
$n = ( $count > $this->max_entries ) ? (int) ceil( $count / $this->max_entries ) : 1;
for ( $i = 0; $i < $n; $i++ ) {
$count = ( $n > 1 ) ? $i + 1 : '';
// must use custom raw query because WP User Query does not support ordering by usermeta
// Retrieve the newest updated profile timestamp overall
if ( empty( $count ) || $count == $n ) {
$date = $wpdb->get_var( $wpdb->prepare( "
SELECT mt1.meta_value FROM $wpdb->users
INNER JOIN $wpdb->usermeta ON ($wpdb->users.ID = $wpdb->usermeta.user_id)
INNER JOIN $wpdb->usermeta AS mt1 ON ($wpdb->users.ID = mt1.user_id) WHERE 1=1
AND ( ($wpdb->usermeta.meta_key = %s AND CAST($wpdb->usermeta.meta_value AS CHAR) != '0')
AND mt1.meta_key = '_yoast_wpseo_profile_updated' ) ORDER BY mt1.meta_value DESC LIMIT 1
",
$wpdb->get_blog_prefix() . 'user_level'
) );
$date = date( 'c', $date );
// Retrieve the newest updated profile timestamp by an offset
} else {
$date = $wpdb->get_var( $wpdb->prepare( "
SELECT mt1.meta_value FROM $wpdb->users
INNER JOIN $wpdb->usermeta ON ($wpdb->users.ID = $wpdb->usermeta.user_id)
INNER JOIN $wpdb->usermeta AS mt1 ON ($wpdb->users.ID = mt1.user_id) WHERE 1=1
AND ( ($wpdb->usermeta.meta_key = %s AND CAST($wpdb->usermeta.meta_value AS CHAR) != '0')
AND mt1.meta_key = '_yoast_wpseo_profile_updated' ) ORDER BY mt1.meta_value ASC LIMIT 1 OFFSET %d
",
$wpdb->get_blog_prefix() . 'user_level',
$this->max_entries * ( $i + 1 ) - 1 ) );
$date = date( 'c', $date );
}
$this->sitemap .= '<sitemap>' . "\n";
$this->sitemap .= '<loc>' . home_url( $base . 'author-sitemap' . $count . '.xml' ) . '</loc>' . "\n";
$this->sitemap .= '<lastmod>' . htmlspecialchars( $date ) . '</lastmod>' . "\n";
$this->sitemap .= '</sitemap>' . "\n";
}
}
// allow other plugins to add their sitemaps to the index
@@ -221,11 +320,10 @@ class WPSEO_Sitemaps {
function build_post_type_map( $post_type ) {
global $wpdb;
$options = get_wpseo_options();
if (
( isset( $options['post_types-' . $post_type . '-not_in_sitemap'] ) && $options['post_types-' . $post_type . '-not_in_sitemap'] )
( isset( $this->options['post_types-' . $post_type . '-not_in_sitemap'] ) && $this->options['post_types-' . $post_type . '-not_in_sitemap'] )
|| in_array( $post_type, array( 'revision', 'nav_menu_item' ) )
|| apply_filters( 'wpseo_sitemap_exclude_post_type', false, $post_type )
) {
$this->bad_sitemap = true;
return;
@@ -243,7 +341,7 @@ class WPSEO_Sitemaps {
$where_filter = '';
$where_filter = apply_filters( 'wpseo_typecount_where', $where_filter, $post_type );
$query = $wpdb->prepare( "SELECT COUNT(ID) FROM $wpdb->posts {$join_filter} WHERE post_status IN ('publish','inherit') AND post_password = '' AND post_type = %s " . $where_filter, $post_type );
$query = $wpdb->prepare( "SELECT COUNT(ID) FROM $wpdb->posts {$join_filter} WHERE post_status IN ('publish','inherit') AND post_password = '' AND post_type = %s " . $where_filter, $post_type );
$typecount = $wpdb->get_var( $query );
if ( $total > $typecount )
@@ -342,7 +440,7 @@ class WPSEO_Sitemaps {
continue;
} else {
if ( isset( $options['trailingslash'] ) && $options['trailingslash'] && $p->post_type != 'post' )
if ( isset( $this->options['trailingslash'] ) && $this->options['trailingslash'] && $p->post_type != 'post' )
$url['loc'] = trailingslashit( $url['loc'] );
}
@@ -456,19 +554,26 @@ class WPSEO_Sitemaps {
* @param string $taxonomy Registered taxonomy's slug
*/
function build_tax_map( $taxonomy ) {
$options = get_wpseo_options();
if (
( isset( $options['taxonomies-' . $taxonomy->name . '-not_in_sitemap'] ) && $options['taxonomies-' . $taxonomy->name . '-not_in_sitemap'] )
( isset( $this->options['taxonomies-' . $taxonomy->name . '-not_in_sitemap'] ) && $this->options['taxonomies-' . $taxonomy->name . '-not_in_sitemap'] )
|| in_array( $taxonomy, array( 'link_category', 'nav_menu', 'post_format' ) )
|| apply_filters( 'wpseo_sitemap_exclude_taxonomy', false, $taxonomy->name )
) {
$this->bad_sitemap = true;
return;
}
$terms = get_terms( $taxonomy->name, array( 'hide_empty' => true ) );
global $wpdb;
$output = '';
$steps = $this->max_entries;
$n = (int) get_query_var( 'sitemap_n' );
$offset = ( $n > 1 ) ? ( $n - 1 ) * $this->max_entries : 0;
$total = $offset + $this->max_entries;
$terms = get_terms( $taxonomy->name, array( 'hide_empty' => true ) );
$terms = array_splice( $terms, $offset, $steps );
foreach ( $terms as $c ) {
$url = array();
@@ -483,7 +588,7 @@ class WPSEO_Sitemaps {
$url['loc'] = wpseo_get_term_meta( $c, $c->taxonomy, 'canonical' );
if ( !$url['loc'] ) {
$url['loc'] = get_term_link( $c, $c->taxonomy );
if ( isset( $options['trailingslash'] ) && $options['trailingslash'] )
if ( isset( $this->options['trailingslash'] ) && $this->options['trailingslash'] )
$url['loc'] = trailingslashit( $url['loc'] );
}
if ( $c->count > 10 ) {
@@ -495,7 +600,7 @@ class WPSEO_Sitemaps {
}
// Grab last modified date
$sql = $wpdb->prepare( "SELECT MAX(p.post_date) AS lastmod
$sql = $wpdb->prepare( "SELECT MAX(p.post_modified_gmt) AS lastmod
FROM $wpdb->posts AS p
INNER JOIN $wpdb->term_relationships AS term_rel
ON term_rel.object_id = p.ID
@@ -521,6 +626,84 @@ class WPSEO_Sitemaps {
$this->sitemap .= $output . '</urlset>';
}
/**
* Build the sub-sitemap for authors
*
* @since 1.4.8
*/
function build_user_map() {
if ( isset( $this->options['disable-author'] ) || isset( $this->options['disable_author_sitemap'] ) ) {
$this->bad_sitemap = true;
return;
}
$output = '';
$steps = 25;
$n = (int) get_query_var( 'sitemap_n' );
$offset = ( $n > 1 ) ? ( $n - 1 ) * $this->max_entries : 0;
// initial query to fill in missing usermeta with the current timestamp
$users = get_users( array(
'who' => 'authors',
'meta_query' => array(
array(
'key' => '_yoast_wpseo_profile_updated',
'value' => '', // This is ignored, but is necessary...
'compare' => 'NOT EXISTS'
)
)
) );
foreach ( $users as $user ) {
update_user_meta( $user->ID, '_yoast_wpseo_profile_updated', time() );
}
// query for users with this meta
$users = get_users( array(
'who' => 'authors',
'offset' => $offset,
'number' => $steps,
'meta_key' => '_yoast_wpseo_profile_updated',
'orderby' => 'meta_value_num',
'order' => 'ASC',
) );
$users = apply_filters( 'wpseo_sitemap_exclude_author', $users );
// ascending sort
usort( $users, array( $this, 'user_map_sorter' ) );
foreach ( $users as $user ) {
if ( $author_link = get_author_posts_url( $user->ID ) ) {
$output .= $this->sitemap_url( array(
'loc' => $author_link,
'pri' => 0.8,
'chf' => 'weekly',
'mod' => date( 'c', $user->_yoast_wpseo_profile_updated )
) );
}
}
if ( empty( $output ) ) {
$this->bad_sitemap = true;
return;
}
$this->sitemap = '<urlset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1" ';
$this->sitemap .= 'xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd" ';
$this->sitemap .= 'xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">' . "\n";
$this->sitemap .= $output;
// Filter to allow adding extra URLs, only do this on the first XML sitemap, not on all.
if ( $n == 0 )
$this->sitemap .= apply_filters( 'wpseo_sitemap_author_content', '' );
$this->sitemap .= '</urlset>';
}
/**
* Spit out the generated sitemap and relevant headers and encoding information.
*/
@@ -550,7 +733,8 @@ class WPSEO_Sitemaps {
$date = mysql2date( "Y-m-d\TH:i:s+00:00", $url['mod'] );
else
$date = date( 'c' );
$output = "\t<url>\n";
$url['loc'] = htmlspecialchars( $url['loc'] );
$output = "\t<url>\n";
$output .= "\t\t<loc>" . $url['loc'] . "</loc>\n";
$output .= "\t\t<lastmod>" . $date . "</lastmod>\n";
$output .= "\t\t<changefreq>" . $url['chf'] . "</changefreq>\n";
@@ -623,6 +807,38 @@ class WPSEO_Sitemaps {
$result = date( 'c', $result );
return $result;
}
/**
* Parse the requested sitemap's identifier to check for a user sitemap pattern
*
* since 1.6
*
* @param string $type The requested sitemap's identifier.
* @return string $user a WP_User object or false
*/
private function is_user_sitemap( $type ) {
$pieces = explode( '-', $type, 2 );
$user = isset( $pieces[1] ) ? $pieces[1] : '';
return get_user_by( 'slug', $user );
}
/**
* Sorts an array of WP_User by the _yoast_wpseo_profile_updated meta field
*
* since 1.6
*
* @param Wp_User $a The first WP user
* @param Wp_User $b The second WP user
* @return int 0 if equal, 1 if $a is larger else or -1;
*/
private function user_map_sorter( $a, $b ) {
if ( $a->_yoast_wpseo_profile_updated == $b->_yoast_wpseo_profile_updated ) {
return 0;
}
return ( $a->_yoast_wpseo_profile_updated > $b->_yoast_wpseo_profile_updated ) ? 1 : -1;
}
}
global $wpseo_sitemaps;
@@ -315,6 +315,21 @@ function wpseo_strip_shortcode( $text ) {
return preg_replace( '|\[[^\]]+\]|s', '', $text );
}
/**
* Redirect /sitemap.xml to /sitemap_index.xml
*/
function wpseo_xml_redirect_sitemap() {
global $wp_query;
$current_url =( isset($_SERVER["HTTPS"] ) && $_SERVER["HTTPS"]=='on' ) ? 'https://' : 'http://';
$current_url .= $_SERVER["SERVER_NAME"] . $_SERVER["REQUEST_URI"];
// must be 'sitemap.xml' and must be 404
if ( home_url( '/sitemap.xml' ) == $current_url && $wp_query->is_404) {
wp_redirect( home_url( '/sitemap_index.xml' ) );
}
}
/**
* Initialize sitemaps. Add sitemap rewrite rules and query var
*/
@@ -323,12 +338,14 @@ function wpseo_xml_sitemaps_init() {
if ( !isset( $options['enablexmlsitemap'] ) || !$options['enablexmlsitemap'] )
return;
// redirects sitemap.xml to sitemap_index.xml
add_action( 'template_redirect', 'wpseo_xml_redirect_sitemap', 0 );
$GLOBALS['wp']->add_query_var( 'sitemap' );
$GLOBALS['wp']->add_query_var( 'sitemap_n' );
add_rewrite_rule( 'sitemap_index\.xml$', 'index.php?sitemap=1', 'top' );
add_rewrite_rule( '([^/]+?)-sitemap([0-9]+)?\.xml$', 'index.php?sitemap=$matches[1]&sitemap_n=$matches[2]', 'top' );
}
add_action( 'init', 'wpseo_xml_sitemaps_init', 1 );
/**
@@ -3,6 +3,8 @@
* @package Internals
*/
include 'class-sitemap-walker.php';
if ( !defined( 'WPSEO_VERSION' ) ) {
header( 'HTTP/1.0 403 Forbidden' );
die;
@@ -175,31 +177,41 @@ function wpseo_deactivate() {
* @param int $val The decimal score to translate.
* @return string
*/
function wpseo_translate_score( $val ) {
function wpseo_translate_score( $val, $css = true ) {
switch ( $val ) {
case 0:
$score = 'na';
$score = __( 'N/A', 'wordpress-seo' );
$css = 'na';
break;
case 4:
case 5:
$score = 'poor';
$score = __( 'Poor', 'wordpress-seo' );
$css = 'poor';
break;
case 6:
case 7:
$score = 'ok';
$score = __( 'OK', 'wordpress-seo' );
$css = 'ok';
break;
case 8:
case 9:
case 10:
$score = 'good';
$score = __( 'Good', 'wordpress-seo' );
$css = 'good';
break;
default:
$score = 'bad';
$score = __( 'Bad', 'wordpress-seo' );
$css = 'bad';
break;
}
return $score;
if ( $css )
return $css;
else
return $score;
}
/**
* Adds an SEO admin bar menu with several options. If the current user is an admin he can also go straight to several settings menu's from here.
*/
@@ -224,7 +236,9 @@ function wpseo_admin_bar_menu() {
$focuskw = wpseo_get_value( 'focuskw', $post->ID );
$perc_score = wpseo_get_value( 'linkdex', $post->ID );
$txtscore = wpseo_translate_score( round( $perc_score / 10 ) );
$score = '<div title="' . ucfirst( $txtscore ) . '" class="wpseo_score_img ' . $txtscore . ' ' . $perc_score . '"></div>';
$title = wpseo_translate_score( round( $perc_score / 10 ), $css = false );
$score = '<div title="' . esc_attr( $title ) . '" class="wpseo_score_img ' . $txtscore . ' ' . $perc_score . '"></div>';
$seo_url = get_edit_post_link( $post->ID );
if ( $txtscore != 'na' )
$seo_url .= '#wpseo_linkdex';
@@ -311,4 +325,217 @@ function allow_custom_field_edits( $allcaps, $cap, $args ) {
return $allcaps;
}
add_filter( 'user_has_cap', 'allow_custom_field_edits', 0, 3 );
/**
* Generate an HTML sitemap
*
* @param array $atts The attributes passed to the shortcode.
*
* @return string
*/
function wpseo_sitemap_handler( $atts ) {
$atts = shortcode_atts( array(
'authors' => true,
'pages' => true,
'posts' => true,
'archives' => true
), $atts );
$display_authors = ( $atts['authors'] === 'no' ) ? false : true;
$display_pages = ( $atts['pages'] === 'no' ) ? false : true;
$display_posts = ( $atts['posts'] === 'no' ) ? false : true;
$display_archives = ( $atts['archives'] === 'no' ) ? false : true;
$options = get_wpseo_options();
// Delete the transient if any of these are no
if ( $display_authors === 'no' || $display_pages === 'no' || $display_posts === 'no' ) {
delete_transient( 'html-sitemap' );
}
// Get any existing copy of our transient data
if ( false !== ( $output = get_transient( 'html-sitemap' ) ) ) {
// $output .= 'CACHE'; // debug
// return $output;
}
$output = '';
// create author list
if ( $display_authors ) {
$output .= '<h2 id="authors">' . __( 'Authors', 'wordpress-seo' ) . '</h2><ul>';
// use echo => false b/c shortcode format screws up
$author_list = wp_list_authors(
array(
'exclude_admin' => false,
'echo' => false,
)
);
$output .= $author_list;
$output .= '</ul>';
}
// create page list
if ( $display_pages ) {
$output .= '<h2 id="pages">' . __( 'Pages', 'wordpress-seo' ) . '</h2><ul>';
// Add pages you'd like to exclude in the exclude here
// possibly have this controlled by shortcode params
$page_list = wp_list_pages(
array(
'exclude' => '',
'title_li' => '',
'echo' => false,
)
);
$output .= $page_list;
$output .= '</ul>';
}
// create post list
if ( $display_posts ) {
$output .= '<h2 id="posts">' . __( 'Posts', 'wordpress-seo' ) . '</h2><ul>';
// Add categories you'd like to exclude in the exclude here
// possibly have this controlled by shortcode params
$cats = get_categories( 'exclude=' );
foreach ( $cats as $cat ) {
$output .= "<li>" . $cat->cat_name;
$output .= "<ul>";
$args = array(
'post_type' => 'post',
'post_status' => 'publish',
'posts_per_page' => -1,
'cat' => $cat->cat_ID,
'meta_query' => array(
'relation' => 'OR',
// include if this key doesn't exists
array(
'key' => '_yoast_wpseo_meta-robots-noindex',
'value' => '', // This is ignored, but is necessary...
'compare' => 'NOT EXISTS'
),
// OR if key does exists include if it is not 1
array(
'key' => '_yoast_wpseo_meta-robots-noindex',
'value' => '1',
'compare' => '!='
),
// OR this key overrides it
array(
'key' => '_yoast_wpseo_sitemap-html-include',
'value' => 'always',
'compare' => '='
)
)
);
$posts = get_posts( $args );
foreach ( $posts as $post ) {
$category = get_the_category( $post->ID );
// Only display a post link once, even if it's in multiple categories
if ( $category[0]->cat_ID == $cat->cat_ID ) {
$output .= '<li><a href="' . get_permalink( $post->ID ) . '">' . get_the_title( $post->ID ) . '</a></li>';
}
}
$output .= "</ul>";
$output .= "</li>";
}
}
$output .= '</ul>';
// get all public non-builtin post types
$args = array(
'public' => true,
'_builtin' => false
);
$post_types = get_post_types( $args, 'object' );
// create an noindex array of post types and taxonomies
$noindex = array();
foreach($options as $key => $value) {
if ( strpos( $key, 'noindex-' ) === 0 && $value == 'on' )
$noindex[] = $key;
}
// create custom post type list
foreach ( $post_types as $post_type ) {
if ( ! in_array( 'noindex-' . $post_type->name, $noindex ) ) {
$output .= '<h2 id="' . $post_type->name . '">' . __( $post_type->label, 'wordpress-seo' ) . '</h2><ul>';
$output .= create_type_sitemap_template( $post_type );
$output .= '</ul>';
}
}
// $output = '';
// create archives list
if ( $display_archives ) {
$output .= '<h2 id="archives">' . __( 'Archives', 'wordpress-seo' ) . '</h2><ul>';
foreach ( $post_types as $post_type ) {
if ( $post_type->has_archive && ! in_array( 'noindex-ptarchive-' . $post_type->name, $noindex ) ) {
$output .= '<a href="' . get_post_type_archive_link( $post_type->name ) . '">' . $post_type->labels->name . '</a>';
$output .= create_type_sitemap_template( $post_type );
}
}
$output .= '</ul>';
}
set_transient( 'html-sitemap', $output, 60 );
return $output;
}
add_shortcode( 'wpseo_sitemap', 'wpseo_sitemap_handler' );
function create_type_sitemap_template( $post_type ) {
// $output = '<h2 id="' . $post_type->name . '">' . __( $post_type->label, 'wordpress-seo' ) . '</h2><ul>';
$output = '';
// Get all registered taxonomy of this post type
$taxs = get_object_taxonomies( $post_type->name, 'object' );
// Build the taxonomy tree
$walker = new Sitemap_Walker();
foreach ( $taxs as $key => $tax ) {
$args = array(
'post_type' => $post_type->name,
'tax_query' => array(
array(
'taxonomy' => $key,
'field' => 'id',
'terms' => -1,
'operator' => 'NOT',
)
)
);
$query = new WP_Query( $args );
$title_li = $query->have_posts() ? $tax->labels->name : '';
$output .= wp_list_categories(
array(
'title_li' => $title_li,
'echo' => false,
'taxonomy' => $key,
'show_option_none' => '',
// 'hierarchical' => 0, // uncomment this for a flat list
'walker' => $walker,
'post_type' => $post_type->name // arg used by the Walker class
)
);
}
$output .= '<br />';
return $output;
}
@@ -43,7 +43,7 @@ function wpseo_killBlockingFiles( nonce ) {
jQuery(document).ready(function(){
var active_tab = window.location.hash.replace('#top#','');
if ( active_tab == '' )
active_tab = 'general';
active_tab = jQuery('.wpseotab').attr('id');
jQuery('#'+active_tab).addClass('active');
jQuery('#'+active_tab+'-tab').addClass('nav-tab-active');
@@ -87,14 +87,18 @@ function testFocusKw() {
var focuskwNoDiacritics = removeLowerCaseDiacritics( focuskw );
p2 = new RegExp(focuskwNoDiacritics.replace(/\s+/g,"[-_\\\//]"),'gim');
var metadesc = jQuery('#yoast_wpseo_metadesc').val();
if ( metadesc == '' )
metadesc = jQuery('#wpseosnippet .desc').text();
if (focuskw != '') {
var html = '<p>Your focus keyword was found in:<br/>';
html += 'Article Heading: ' + ptest( jQuery('#title').val(), p ) + '<br/>';
html += 'Page title: ' + ptest( jQuery('#wpseosnippet .title').text(), p ) + '<br/>';
html += 'Page URL: ' + ptest( url, p2 ) + '<br/>';
html += 'Content: ' + ptest( jQuery('#content').val(), p ) + '<br/>';
html += 'Meta description: ' + ptest( jQuery('#yoast_wpseo_metadesc').val(), p );
html += '</p>';
var html = '<p>' + objectL10n.keyword_header + '<br />';
html += objectL10n.article_header_text + ptest( jQuery('#title').val(), p ) + '<br/>';
html += objectL10n.page_title_text + ptest( jQuery('#wpseosnippet .title').text(), p ) + '<br/>';
html += objectL10n.page_url_text + ptest( url, p2 ) + '<br/>';
html += objectL10n.content_text + ptest( jQuery('#content').val(), p ) + '<br/>';
html += objectL10n.meta_description_text + ptest( metadesc, p );
html += '</p>';
jQuery('#focuskwresults').html(html);
} else {
jQuery('#focuskwresults').html('');
@@ -112,8 +116,8 @@ function updateTitle( force ) {
jQuery('#yoast_wpseo_title-length').html( '' );
return;
}
title = jQuery('<div />').html(title).text();
title = jQuery('<div />').text(title).html();
if ( force )
jQuery('#yoast_wpseo_title').val( title );
@@ -173,6 +177,9 @@ function updateDesc( desc ) {
autogen = true;
}
}
desc = jQuery('<div />').text( desc ).html();
desc = yst_clean( desc );
if ( !autogen )
var len = wpseo_meta_desc_length - desc.length;
@@ -247,6 +254,9 @@ jQuery(document).ready(function(){
jQuery('.'+active_tab).addClass('active');
var desc = jQuery.trim( yst_clean( jQuery("#yoast_wpseo_metadesc").val() ) );
desc = jQuery('<div />').html( desc ).text();
jQuery("#yoast_wpseo_metadesc").val( desc );
jQuery('a.wpseo_tablink').click( function($) {
jQuery('.wpseo-metabox-tabs li').removeClass('active');
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,14 @@
<phpunit
bootstrap="tests/bootstrap.php"
backupGlobals="false"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
>
<testsuites>
<testsuite>
<directory prefix="test-" suffix=".php">./tests/</directory>
</testsuite>
</testsuites>
</phpunit>
+58 -41
View File
@@ -5,8 +5,8 @@ License: GPLv3
License URI: http://www.gnu.org/licenses/gpl.html
Tags: seo, SEO, google, meta, meta description, search engine optimization, xml sitemap, xml sitemaps, google sitemap, sitemap, sitemaps, robots meta, rss, rss footer, yahoo, bing, news sitemaps, XML News Sitemaps, WordPress SEO, WordPress SEO by Yoast, yoast, multisite, canonical, nofollow, noindex, keywords, meta keywords, description, webmaster tools, google webmaster tools, seo pack
Requires at least: 3.3
Tested up to: 3.5
Stable tag: 1.4.7
Tested up to: 3.6
Stable tag: 1.4.11
Improve your WordPress SEO: Write better content and have a fully optimized WordPress site using the WordPress SEO plugin by Yoast.
@@ -89,45 +89,7 @@ For more info, check out the following articles:
== Frequently Asked Questions ==
= The SEO title output for the plugin doesn't work as expected =
You've set up a template for your titles, but things get added to it when they're output? You can do two things: either enable "Force rewrite titles" on the SEO -> Titles settings page, or go into your header.php and change the title element to just this:
`<title><?php wp_title(''); ?></title>`
= I'm not seeing a meta description in my `<head>` section? =
Check whether your theme's `header.php` file contains a call to [wp_head()](http://codex.wordpress.org/Function_Reference/wp_head).
= My meta descriptions aren't showing up in the search result pages =
There are two possible issues with a meta description:
1. You're putting out more than one of them due to multiple plugins adding a description, for instance the WordBooker plugin adds a description too but has an option to disable it, other SEO plugins running might be another cause.
1. You're not seeing your meta description show up in the search result pages. Google will not alway show your meta description, the likelihood of your meta description appearing in the search results increases incredibly when your meta description contains the sought for keyword though, which is why the focus keyword functionality checks for the appearance of the focus keyword in the description.
= Page X, Y, Z for plugin X doesn't work with your plugin enabled =
Disable the clean permalinks feature on the SEO -> Permalinks settings page.
= Does your plugin allow for Google News Sitemaps too? =
It does! You'll need an add-on module for that though, which you can download from the [News SEO](http://yoast.com/wordpress/seo/news-seo/) module homepage!
= Why is WordPress SEO better than All In One SEO Pack? =
It's not a secret that the author of this plugin, Joost de Valk, aka Yoast, doesn't really like All In One SEO Pack. The main reason is that All in One SEO pack has a default option for auto generating meta descriptions that is actually making it harder for people to rank well in a lot of cases, giving them a false sense of security.
Once you'll start using this plugin, you won't ask that question anymore, you'll just ask yourself "why does anyone still use All In One SEO"? There's several things this plugin does better: it has a snippet preview in the write post screen that'll help you optimize your titles, meta descriptions and copy instantly while working on your posts and pages.
Also, other than All In One SEO Pack, this plugin has a completely working canonical implementation for all pages within your site, whereas the one in All In One SEO pack is broken, it was originally written by the author of this plugin, so he knows. It comes with XML Sitemaps, an XML News sitemap module, loads and loads of robots meta options and other options to improve your SEO.
= I want to use your XML Sitemaps with NGINX, is that possible? =
Yes, of course! Here are the rewrite rules you'll need:
`rewrite ^/sitemap_index\.xml$ /index.php?sitemap=1 last;
rewrite ^/([^/]+?)-sitemap([0-9]+)?\.xml$ /index.php?sitemap=$1&sitemap_n=$2 last;`
You'll find the [FAQ on Yoast.com](http://yoast.com/wordpress/seo/faq/).
== Screenshots ==
@@ -141,6 +103,61 @@ rewrite ^/([^/]+?)-sitemap([0-9]+)?\.xml$ /index.php?sitemap=$1&sitemap_n=$2 las
== Changelog ==
= 1.4.11 =
* i18n
* Updated de_DE, ru_RU, zh_CN.
* Bugfixes
* Make rel="publisher" markup appear on every page.
* Prevent empty property='article:publisher' markup from being output .
* Fixed twitter:description tag should only appears if OpenGraph is inactive.
* og:description will default to get_the_excerpt when meta description is blank (similar to how twitter:description works).
* Fixes only 25 tags (and other taxonomy) are being indexed in taxonomy sitemaps.
* Fix lastmod dates for taxonomies in XML sitemap index file.
* Enhancements
* Changed Social Admin section to have a tab-layout.
* Moved Google+ section from Homepage tab of Titles & Metas to Social tab.
* Make twitter:domain use WordPress site name instead of domainname.
* Added more output filters in the Twitter class.
= 1.4.10 =
* Fixes
* Caching was disabled in certain cases, this update fixes that.
* Enhancements
* Added option to disable author sitemap.
* If author pages are disabled, author sitemaps are now automatically disabled.
= 1.4.9 =
* i18n
* Updated .pot file
* Updated ar, da_DK, de_DE, el_GR, es_ES, fa_IR, fr_FR, he_IL, id_ID, nl_NL, ro_RO, sv_SE & tr_TK
* Added hr & sl_SI
* Many localization fixes
* Bugfixes
* Fixed sitemap "loc" element to have encoded entities.
* Honor the language setting if other plugins set the language.
* sitemap.xml will now redirect to sitemap_index.xml if it doesn't exist statically.
* Added filters 'wpseo_sitemap_exclude_post_type' and 'wpseo_sitemap_exclude_taxonomy' to allow themes/plugins to exclude entries in the XML sitemap.
* Added RTL support, some CSS fixes.
* Focus word gets counted in meta description when defined by a template.
* Fixed some bugs with the focus keyword in the first paragraph test.
* Fixed display bug in SEO Title column when defined by a template ('Page # of #').
* Fixed a few strict notices that would pop up in WP 3.6.
* Prevent other plugins from overriding the WP SEO menu position.
* Enabled the advanced tab for site-admins on a multi-site install.
* Fixed post save error when page analysis is disabled.
* OpenGraph frontpage og:description and og:image tags now properly added to the frontpage.
* Enhancements
* Added an HTML sitemap shortcode [wpseo_sitemap].
* Added an XML sitemap listing the author profile URLs.
* Added detection of Yoast's robots meta plugin and All In One SEO plugins, plugin now gives a notice to import settings and disable those plugins.
* Prevent empty image tags in Twitter Cards - props [Mike Bijon](https://github.com/mbijon).
* Add new `twitter:domain` tag - props [Mike Bijon](https://github.com/mbijon).
* Add support for Facebooks new OG tags for media publishers.
* Allow authorship to be removed per post type.
= 1.4.7 =
* Properly fix security bug that should've been fixed in 1.4.5.
@@ -0,0 +1,22 @@
<?php
require_once getenv( 'WP_TESTS_DIR' ) . '/includes/functions.php';
function _manually_load_plugin() {
require dirname( __FILE__ ) . '/../wp-seo.php';
}
tests_add_filter( 'muplugins_loaded', '_manually_load_plugin' );
require getenv( 'WP_TESTS_DIR' ) . '/includes/bootstrap.php';
class WPSEO_TestCase extends WP_UnitTestCase {
// Put convenience methods here
// Here are two I use for faking things for save_post hooks, et al
function set_post( $key, $value ) {
$_POST[$key] = $_REQUEST[$key] = addslashes( $value );
}
function unset_post( $key ) {
unset( $_POST[$key], $_REQUEST[$key] );
}
}
@@ -0,0 +1,7 @@
<?php
class WPSEO_Test_Unit_Tests extends WPSEO_TestCase {
function test_true_is_true() {
$this->assertTrue( true ); // Yay, your unit tests are running!
}
}
+7 -4
View File
@@ -1,7 +1,7 @@
<?php
/*
Plugin Name: WordPress SEO
Version: 1.4.7
Version: 1.4.11
Plugin URI: http://yoast.com/wordpress/seo/#utm_source=wpadmin&utm_medium=plugin&utm_campaign=wpseoplugin
Description: The first true all-in-one SEO solution for WordPress, including on-page content analysis, XML sitemaps and much more.
Author: Joost de Valk
@@ -34,7 +34,7 @@ if ( !defined( 'DB_NAME' ) ) {
}
if ( !defined( 'WPSEO_URL' ) )
define( 'WPSEO_URL', plugin_dir_url( __FILE__ ) );
define( 'WPSEO_URL', plugins_url() . '/' . basename( dirname(__FILE__) ) . '/' );
if ( !defined( 'WPSEO_PATH' ) )
define( 'WPSEO_PATH', plugin_dir_path( __FILE__ ) );
if ( !defined( 'WPSEO_BASENAME' ) )
@@ -42,7 +42,10 @@ if ( !defined( 'WPSEO_BASENAME' ) )
define( 'WPSEO_FILE', __FILE__ );
load_plugin_textdomain( 'wordpress-seo', false, dirname( plugin_basename( __FILE__ ) ) . '/languages' );
function wpseo_load_textdomain() {
load_plugin_textdomain( 'wordpress-seo', false, dirname( plugin_basename( __FILE__ ) ) . '/languages' );
}
add_filter( 'wp_loaded', 'wpseo_load_textdomain' );
if ( version_compare( PHP_VERSION, '5.2', '<' ) ) {
if ( is_admin() && ( !defined( 'DOING_AJAX' ) || !DOING_AJAX ) ) {
@@ -54,7 +57,7 @@ if ( version_compare( PHP_VERSION, '5.2', '<' ) ) {
}
}
define( 'WPSEO_VERSION', '1.4.7' );
define( 'WPSEO_VERSION', '1.4.11' );
$pluginurl = plugin_dir_url( __FILE__ );
if ( preg_match( '/^https/', $pluginurl ) && !preg_match( '/^https/', get_bloginfo( 'url' ) ) )
View File
File mode changed.
+1 -1
View File
@@ -45,7 +45,7 @@
</div>
<div class="bluebordered text-center small-6 columns">
<a href="/blogg" class="hover blog" title="Blogg"><span></span></a>
</div>
</div>
<div class="row">
+2 -2
View File
@@ -21,8 +21,8 @@
<link rel="shortcut icon" href="<?php echo get_template_directory_uri(); ?>/favicon.ico">
<![endif]-->
<!-- or, set /favicon.ico for IE10 win -->
<meta name="msapplication-TileColor" content="#f01d4f">
<meta name="msapplication-TileImage" content="<?php echo get_template_directory_uri(); ?>/images/win8-tile-icon.png">
<meta name="msapplication-TileColor" content="#ff8200">
<meta name="msapplication-TileImage" content="<?php echo get_template_directory_uri(); ?>/screenshot.png">
<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>">
<!-- Stylesheets -->
<link href='//fonts.googleapis.com/css?family=Open+Sans:400italic,400,600,700' rel='stylesheet' type='text/css'>
+7 -5
View File
@@ -66,7 +66,11 @@ class WP_SimplePie_File extends SimplePie_File {
$this->method = SIMPLEPIE_FILE_SOURCE_REMOTE;
if ( preg_match('/^http(s)?:\/\//i', $url) ) {
$args = array( 'timeout' => $this->timeout, 'redirection' => $this->redirects);
$args = array(
'timeout' => $this->timeout,
'redirection' => $this->redirects,
'reject_unsafe_urls' => true,
);
if ( !empty($this->headers) )
$args['headers'] = $this->headers;
@@ -85,10 +89,8 @@ class WP_SimplePie_File extends SimplePie_File {
$this->status_code = wp_remote_retrieve_response_code( $res );
}
} else {
if ( ! file_exists($url) || ( ! $this->body = file_get_contents($url) ) ) {
$this->error = 'file_get_contents could not read the file';
$this->success = false;
}
$this->error = '';
$this->success = false;
}
}
}
+24 -11
View File
@@ -86,7 +86,8 @@ class WP_Http {
'timeout' => apply_filters( 'http_request_timeout', 5),
'redirection' => apply_filters( 'http_request_redirection_count', 5),
'httpversion' => apply_filters( 'http_request_version', '1.0'),
'user-agent' => apply_filters( 'http_headers_useragent', 'WordPress/' . $wp_version . '; ' . get_bloginfo( 'url' ) ),
'user-agent' => apply_filters( 'http_headers_useragent', 'WordPress/' . $wp_version . '; ' . get_bloginfo( 'url' ) ),
'reject_unsafe_urls' => apply_filters( 'http_request_reject_unsafe_urls', false ),
'blocking' => true,
'headers' => array(),
'cookies' => array(),
@@ -108,15 +109,21 @@ class WP_Http {
$r = wp_parse_args( $args, $defaults );
$r = apply_filters( 'http_request_args', $r, $url );
// Certain classes decrement this, store a copy of the original value for loop purposes.
$r['_redirection'] = $r['redirection'];
// The transports decrement this, store a copy of the original value for loop purposes.
if ( ! isset( $r['_redirection'] ) )
$r['_redirection'] = $r['redirection'];
// Allow plugins to short-circuit the request
$pre = apply_filters( 'pre_http_request', false, $r, $url );
if ( false !== $pre )
return $pre;
$arrURL = parse_url( $url );
if ( $r['reject_unsafe_urls'] )
$url = wp_http_validate_url( $url );
if ( function_exists( 'wp_kses_bad_protocol' ) )
$url = wp_kses_bad_protocol( $url, array( 'http', 'https', 'ssl' ) );
$arrURL = @parse_url( $url );
if ( empty( $url ) || empty( $arrURL['scheme'] ) )
return new WP_Error('http_request_failed', __('A valid URL was not provided.'));
@@ -777,7 +784,7 @@ class WP_Http_Fsockopen {
// If location is found, then assume redirect and redirect to location.
if ( isset($arrHeaders['headers']['location']) && 0 !== $r['_redirection'] ) {
if ( $r['redirection']-- > 0 ) {
return $this->request( WP_HTTP::make_absolute_url( $arrHeaders['headers']['location'], $url ), $r);
return wp_remote_request( WP_HTTP::make_absolute_url( $arrHeaders['headers']['location'], $url ), $r);
} else {
return new WP_Error('http_request_failed', __('Too many redirects.'));
}
@@ -887,7 +894,8 @@ class WP_Http_Streams {
array(
'method' => strtoupper($r['method']),
'user_agent' => $r['user-agent'],
'max_redirects' => $r['redirection'] + 1, // See #11557
'max_redirects' => 0, // Follow no redirects
'follow_redirects' => false,
'protocol_version' => (float) $r['httpversion'],
'header' => $strHeaders,
'ignore_errors' => true, // Return non-200 requests.
@@ -960,10 +968,13 @@ class WP_Http_Streams {
else
$processedHeaders = WP_Http::processHeaders($meta['wrapper_data']);
// Streams does not provide an error code which we can use to see why the request stream stopped.
// We can however test to see if a location header is present and return based on that.
if ( isset($processedHeaders['headers']['location']) && 0 !== $args['_redirection'] )
return new WP_Error('http_request_failed', __('Too many redirects.'));
if ( ! empty( $processedHeaders['headers']['location'] ) && 0 !== $r['_redirection'] ) { // _redirection: The requested number of redirections
if ( $r['redirection']-- > 0 ) {
return wp_remote_request( WP_HTTP::make_absolute_url( $processedHeaders['headers']['location'], $url ), $r );
} else {
return new WP_Error( 'http_request_failed', __( 'Too many redirects.' ) );
}
}
if ( ! empty( $strResponse ) && isset( $processedHeaders['headers']['transfer-encoding'] ) && 'chunked' == $processedHeaders['headers']['transfer-encoding'] )
$strResponse = WP_Http::chunkTransferDecode($strResponse);
@@ -1088,6 +1099,8 @@ class WP_Http_Curl {
// The option doesn't work with safe mode or when open_basedir is set, and there's a
// bug #17490 with redirected POST requests, so handle redirections outside Curl.
curl_setopt( $handle, CURLOPT_FOLLOWLOCATION, false );
if ( defined( 'CURLOPT_PROTOCOLS' ) ) // PHP 5.2.10 / cURL 7.19.4
curl_setopt( $handle, CURLOPT_PROTOCOLS, CURLPROTO_HTTP | CURLPROTO_HTTPS );
switch ( $r['method'] ) {
case 'HEAD':
@@ -1178,7 +1191,7 @@ class WP_Http_Curl {
// See #11305 - When running under safe mode, redirection is disabled above. Handle it manually.
if ( ! empty( $theHeaders['headers']['location'] ) && 0 !== $r['_redirection'] ) { // _redirection: The requested number of redirections
if ( $r['redirection']-- > 0 ) {
return $this->request( WP_HTTP::make_absolute_url( $theHeaders['headers']['location'], $url ), $r );
return wp_remote_request( WP_HTTP::make_absolute_url( $theHeaders['headers']['location'], $url ), $r );
} else {
return new WP_Error( 'http_request_failed', __( 'Too many redirects.' ) );
}
+13 -24
View File
@@ -108,7 +108,7 @@ class WP_oEmbed {
$providers = array();
// Fetch URL content
if ( $html = wp_remote_retrieve_body( wp_remote_get( $url ) ) ) {
if ( $html = wp_remote_retrieve_body( wp_remote_get( $url, array( 'reject_unsafe_urls' => true ) ) ) ) {
// <link> types that contain oEmbed provider URLs
$linktypes = apply_filters( 'oembed_linktypes', array(
@@ -190,7 +190,7 @@ class WP_oEmbed {
*/
function _fetch_with_format( $provider_url_with_args, $format ) {
$provider_url_with_args = add_query_arg( 'format', $format, $provider_url_with_args );
$response = wp_remote_get( $provider_url_with_args );
$response = wp_remote_get( $provider_url_with_args, array( 'reject_unsafe_urls' => true ) );
if ( 501 == wp_remote_retrieve_response_code( $response ) )
return new WP_Error( 'not-implemented' );
if ( ! $body = wp_remote_retrieve_body( $response ) )
@@ -219,35 +219,24 @@ class WP_oEmbed {
if ( !function_exists('simplexml_load_string') ) {
return false;
}
if ( ! class_exists( 'DOMDocument' ) )
if ( ! function_exists( 'libxml_disable_entity_loader' ) )
return false;
$loader = libxml_disable_entity_loader( true );
$errors = libxml_use_internal_errors( true );
$old_value = null;
if ( function_exists( 'libxml_disable_entity_loader' ) ) {
$old_value = libxml_disable_entity_loader( true );
}
$dom = new DOMDocument;
$success = $dom->loadXML( $response_body );
if ( ! is_null( $old_value ) ) {
libxml_disable_entity_loader( $old_value );
}
$data = simplexml_load_string( $response_body );
libxml_use_internal_errors( $errors );
if ( ! $success || isset( $dom->doctype ) ) {
return false;
$return = false;
if ( is_object( $data ) ) {
$return = new stdClass;
foreach ( $data as $key => $value ) {
$return->$key = (string) $value;
}
}
$data = simplexml_import_dom( $dom );
if ( ! is_object( $data ) )
return false;
$return = new stdClass;
foreach ( $data as $key => $value )
$return->$key = (string) $value;
libxml_disable_entity_loader( $loader );
return $return;
}
+1 -1
View File
@@ -253,7 +253,7 @@ class PasswordHash {
if ($hash[0] == '*')
$hash = crypt($password, $stored_hash);
return $hash == $stored_hash;
return $hash === $stored_hash;
}
}
+2
View File
@@ -354,7 +354,9 @@ class WP_Admin_Bar {
$this->_render_group( $group );
} ?>
</div>
<?php if ( is_user_logged_in() ) : ?>
<a class="screen-reader-shortcut" href="<?php echo esc_url( wp_logout_url() ); ?>"><?php _e('Log Out'); ?></a>
<?php endif; ?>
</div>
<?php
+2 -1
View File
@@ -5380,7 +5380,8 @@ class wp_xmlrpc_server extends IXR_Server {
sleep(1);
// Let's check the remote site
$linea = wp_remote_retrieve_body( wp_remote_get( $pagelinkedfrom, array( 'timeout' => 10, 'redirection' => 0 ) ) );
$linea = wp_remote_retrieve_body( wp_remote_get( $pagelinkedfrom, array( 'timeout' => 10, 'redirection' => 0, 'reject_unsafe_urls' => true ) ) );
if ( !$linea )
return $this->pingback_error( 16, __( 'The source URL does not exist.' ) );
+5 -53
View File
@@ -1661,7 +1661,7 @@ function discover_pingback_server_uri( $url, $deprecated = '' ) {
if ( 0 === strpos($url, $uploads_dir['baseurl']) )
return false;
$response = wp_remote_head( $url, array( 'timeout' => 2, 'httpversion' => '1.0' ) );
$response = wp_remote_head( $url, array( 'timeout' => 2, 'httpversion' => '1.0', 'reject_unsafe_urls' => true ) );
if ( is_wp_error( $response ) )
return false;
@@ -1674,7 +1674,7 @@ function discover_pingback_server_uri( $url, $deprecated = '' ) {
return false;
// Now do a GET since we're going to look in the html headers (and we're sure its not a binary file)
$response = wp_remote_get( $url, array( 'timeout' => 2, 'httpversion' => '1.0' ) );
$response = wp_remote_get( $url, array( 'timeout' => 2, 'httpversion' => '1.0', 'reject_unsafe_urls' => true ) );
if ( is_wp_error( $response ) )
return false;
@@ -1908,6 +1908,7 @@ function trackback($trackback_url, $title, $excerpt, $ID) {
$options = array();
$options['timeout'] = 4;
$options['reject_unsafe_urls'] = true;
$options['body'] = array(
'title' => $title,
'url' => get_permalink($ID),
@@ -1955,62 +1956,13 @@ function weblog_ping($server = '', $path = '') {
* Default filter attached to pingback_ping_source_uri to validate the pingback's Source URI
*
* @since 3.5.1
* @see wp_http_validate_url()
*
* @param string $source_uri
* @return string
*/
function pingback_ping_source_uri( $source_uri ) {
$uri = esc_url_raw( $source_uri, array( 'http', 'https' ) );
if ( ! $uri )
return '';
$parsed_url = @parse_url( $uri );
if ( ! $parsed_url )
return '';
if ( isset( $parsed_url['user'] ) || isset( $parsed_url['pass'] ) )
return '';
if ( false !== strpos( $parsed_url['host'], ':' ) )
return '';
$parsed_home = @parse_url( get_option( 'home' ) );
$same_host = strtolower( $parsed_home['host'] ) === strtolower( $parsed_url['host'] );
if ( ! $same_host ) {
$host = trim( $parsed_url['host'], '.' );
if ( preg_match( '#^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$#', $host ) ) {
$ip = $host;
} else {
$ip = gethostbyname( $host );
if ( $ip === $host ) // Error condition for gethostbyname()
$ip = false;
}
if ( $ip ) {
if ( '127.0.0.1' === $ip )
return '';
$parts = array_map( 'intval', explode( '.', $ip ) );
if ( 10 === $parts[0] )
return '';
if ( 172 === $parts[0] && 16 <= $parts[1] && 31 >= $parts[1] )
return '';
if ( 192 === $parts[0] && 168 === $parts[1] )
return '';
}
}
if ( empty( $parsed_url['port'] ) )
return $uri;
$port = $parsed_url['port'];
if ( 80 === $port || 443 === $port || 8080 === $port )
return $uri;
if ( $parsed_home && $same_host && $parsed_home['port'] === $port )
return $uri;
return '';
return (string) wp_http_validate_url( $source_uri );
}
/**
+1 -1
View File
@@ -3298,7 +3298,7 @@ function image_resize( $file, $max_w, $max_h, $crop = false, $suffix = null, $de
*/
function wp_get_single_post( $postid = 0, $mode = OBJECT ) {
_deprecated_function( __FUNCTION__, '3.5', 'get_post()' );
return get_post( $postid, $mode, 'edit' );
return get_post( $postid, $mode );
}
/**
+4 -3
View File
@@ -2601,10 +2601,11 @@ function esc_url( $url, $protocols = null, $_context = 'display' ) {
if ( ! is_array( $protocols ) )
$protocols = wp_allowed_protocols();
if ( wp_kses_bad_protocol( $url, $protocols ) != $url )
$good_protocol_url = wp_kses_bad_protocol( $url, $protocols );
if ( strtolower( $good_protocol_url ) != strtolower( $url ) )
return '';
return apply_filters('clean_url', $url, $original_url, $_context);
return apply_filters('clean_url', $good_protocol_url, $original_url, $_context);
}
/**
@@ -2869,7 +2870,7 @@ function sanitize_option($option, $value) {
case 'illegal_names':
if ( ! is_array( $value ) )
$value = explode( "\n", $value );
$value = explode( ' ', $value );
$value = array_values( array_filter( array_map( 'trim', $value ) ) );
+14 -6
View File
@@ -496,6 +496,7 @@ function wp_get_http( $url, $file_path = false, $red = 1 ) {
$options = array();
$options['redirection'] = 5;
$options['reject_unsafe_urls'] = true;
if ( false == $file_path )
$options['method'] = 'HEAD';
@@ -543,7 +544,7 @@ function wp_get_http_headers( $url, $deprecated = false ) {
if ( !empty( $deprecated ) )
_deprecated_argument( __FUNCTION__, '2.7' );
$response = wp_remote_head( $url );
$response = wp_remote_head( $url, array( 'reject_unsafe_urls' => true ) );
if ( is_wp_error( $response ) )
return false;
@@ -655,10 +656,10 @@ function add_query_arg() {
else
$frag = '';
if ( 0 === stripos( 'http://', $uri ) ) {
if ( 0 === stripos( $uri, 'http://' ) ) {
$protocol = 'http://';
$uri = substr( $uri, 7 );
} elseif ( 0 === stripos( 'https://', $uri ) ) {
} elseif ( 0 === stripos( $uri, 'https://' ) ) {
$protocol = 'https://';
$uri = substr( $uri, 8 );
} else {
@@ -758,6 +759,7 @@ function wp_remote_fopen( $uri ) {
$options = array();
$options['timeout'] = 10;
$options['reject_unsafe_urls'] = true;
$response = wp_remote_get( $uri, $options );
@@ -2954,9 +2956,15 @@ function _doing_it_wrong( $function, $message, $version ) {
// Allow plugin to filter the output error trigger
if ( WP_DEBUG && apply_filters( 'doing_it_wrong_trigger_error', true ) ) {
$version = is_null( $version ) ? '' : sprintf( __( '(This message was added in version %s.)' ), $version );
$message .= ' ' . __( 'Please see <a href="http://codex.wordpress.org/Debugging_in_WordPress">Debugging in WordPress</a> for more information.' );
trigger_error( sprintf( __( '%1$s was called <strong>incorrectly</strong>. %2$s %3$s' ), $function, $message, $version ) );
if ( function_exists( '__' ) ) {
$version = is_null( $version ) ? '' : sprintf( __( '(This message was added in version %s.)' ), $version );
$message .= ' ' . __( 'Please see <a href="http://codex.wordpress.org/Debugging_in_WordPress">Debugging in WordPress</a> for more information.' );
trigger_error( sprintf( __( '%1$s was called <strong>incorrectly</strong>. %2$s %3$s' ), $function, $message, $version ) );
} else {
$version = is_null( $version ) ? '' : sprintf( '(This message was added in version %s.)', $version );
$message .= ' Please see <a href="http://codex.wordpress.org/Debugging_in_WordPress">Debugging in WordPress</a> for more information.';
trigger_error( sprintf( '%1$s was called <strong>incorrectly</strong>. %2$s %3$s', $function, $message, $version ) );
}
}
}
+61
View File
@@ -311,3 +311,64 @@ function send_origin_headers() {
return false;
}
/**
* Validate a URL for safe use in the HTTP API.
*
* @since 3.5.2
*
* @return mixed URL or false on failure.
*/
function wp_http_validate_url( $url ) {
$url = esc_url_raw( $url, array( 'http', 'https' ) );
if ( ! $url )
return false;
$parsed_url = @parse_url( $url );
if ( ! $parsed_url )
return false;
if ( isset( $parsed_url['user'] ) || isset( $parsed_url['pass'] ) )
return false;
if ( false !== strpos( $parsed_url['host'], ':' ) )
return false;
$parsed_home = @parse_url( get_option( 'home' ) );
$same_host = strtolower( $parsed_home['host'] ) === strtolower( $parsed_url['host'] );
if ( ! $same_host ) {
$host = trim( $parsed_url['host'], '.' );
if ( preg_match( '#^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$#', $host ) ) {
$ip = $host;
} else {
$ip = gethostbyname( $host );
if ( $ip === $host ) // Error condition for gethostbyname()
$ip = false;
}
if ( $ip ) {
if ( '127.0.0.1' === $ip )
return false;
$parts = array_map( 'intval', explode( '.', $ip ) );
if ( 10 === $parts[0] )
return false;
if ( 172 === $parts[0] && 16 <= $parts[1] && 31 >= $parts[1] )
return false;
if ( 192 === $parts[0] && 168 === $parts[1] )
return false;
}
}
if ( empty( $parsed_url['port'] ) )
return $url;
$port = $parsed_url['port'];
if ( 80 === $port || 443 === $port || 8080 === $port )
return $url;
if ( $parsed_home && $same_host && $parsed_home['port'] === $port )
return $url;
return false;
}
+1
View File
@@ -170,6 +170,7 @@
icontag: 'dt',
captiontag: 'dd',
columns: '3',
link: 'post',
size: 'thumbnail',
orderby: 'menu_order ID'
},
+1 -1
View File
@@ -1 +1 @@
(function(b){var a={};wp.media.string={props:function(f,i){var h,c,e,g,d,j=wp.media.view.settings.defaultProps;d=function(k){if("image"===k.type&&!k.alt){k.alt=k.caption||k.title||"";k.alt=k.alt.replace(/<\/?[^>]+>/g,"");k.alt=k.alt.replace(/[\r\n]+/g," ")}return k};f=f?_.clone(f):{};if(i&&i.type){f.type=i.type}if("image"===f.type){f=_.defaults(f||{},{align:j.align||getUserSetting("align","none"),size:j.size||getUserSetting("imgsize","medium"),url:"",classes:[]})}if(!i){return d(f)}f.title=f.title||i.title;h=f.link||j.link||getUserSetting("urlbutton","file");if("file"===h){c=i.url}else{if("post"===h){c=i.link}else{if("custom"===h){c=f.linkUrl}}}f.linkUrl=c||"";if("image"===i.type){f.classes.push("wp-image-"+i.id);g=i.sizes;e=g&&g[f.size]?g[f.size]:i;_.extend(f,_.pick(i,"align","caption","alt"),{width:e.width,height:e.height,src:e.url,captionId:"attachment_"+i.id})}else{f.title=f.title||i.filename;f.rel=f.rel||"attachment wp-att-"+i.id}return d(f)},link:function(d,e){var c;d=wp.media.string.props(d,e);c={tag:"a",content:d.title,attrs:{href:d.linkUrl}};if(d.rel){c.attrs.rel=d.rel}return wp.html.string(c)},image:function(g,i){var c={},d,f,h,e;g=wp.media.string.props(g,i);f=g.classes||[];c.src=g.url;_.extend(c,_.pick(g,"width","height","alt"));if(g.align&&!g.caption){f.push("align"+g.align)}if(g.size){f.push("size-"+g.size)}c["class"]=_.compact(f).join(" ");d={tag:"img",attrs:c,single:true};if(g.linkUrl){d={tag:"a",attrs:{href:g.linkUrl},content:d}}e=wp.html.string(d);if(g.caption){h={};if(c.width){h.width=c.width}if(g.captionId){h.id=g.captionId}if(g.align){h.align="align"+g.align}e=wp.shortcode.string({tag:"caption",attrs:h,content:e+" "+g.caption})}return e}};wp.media.gallery=(function(){var c={};return{defaults:{order:"ASC",id:wp.media.view.settings.post.id,itemtag:"dl",icontag:"dt",captiontag:"dd",columns:"3",size:"thumbnail",orderby:"menu_order ID"},attachments:function(h){var j=h.string(),d=c[j],f,e,i,g;delete c[j];if(d){return d}f=_.defaults(h.attrs.named,wp.media.gallery.defaults);e=_.pick(f,"orderby","order");e.type="image";e.perPage=-1;if("rand"===f.orderby){f._orderbyRandom=true}if(!f.orderby||/^menu_order(?: ID)?$/i.test(f.orderby)){e.orderby="menuOrder"}if(f.ids){e.post__in=f.ids.split(",");e.orderby="post__in"}else{if(f.include){e.post__in=f.include.split(",")}}if(f.exclude){e.post__not_in=f.exclude.split(",")}if(!e.post__in){e.uploadedTo=f.id}g=_.omit(f,"id","ids","include","exclude","orderby","order");i=wp.media.query(e);i.gallery=new Backbone.Model(g);return i},shortcode:function(d){var f=d.props.toJSON(),e=_.pick(f,"orderby","order"),g,h;if(d.gallery){_.extend(e,d.gallery.toJSON())}e.ids=d.pluck("id");if(f.uploadedTo){e.id=f.uploadedTo}if(e._orderbyRandom){e.orderby="rand"}delete e._orderbyRandom;if(e.ids&&"post__in"===e.orderby){delete e.orderby}_.each(wp.media.gallery.defaults,function(j,i){if(j===e[i]){delete e[i]}});g=new wp.shortcode({tag:"gallery",attrs:e,type:"single"});h=new wp.media.model.Attachments(d.models,{props:f});h.gallery=d.gallery;c[g.string()]=h;return g},edit:function(g){var f=wp.shortcode.next("gallery",g),h=wp.media.gallery.defaults.id,d,e;if(!f||f.content!==g){return}f=f.shortcode;if(_.isUndefined(f.get("id"))&&!_.isUndefined(h)){f.set("id",h)}d=wp.media.gallery.attachments(f);e=new wp.media.model.Selection(d.models,{props:d.props.toJSON(),multiple:true});e.gallery=d.gallery;e.more().done(function(){e.props.set({query:false});e.unmirror();e.props.unset("orderby")});if(this.frame){this.frame.dispose()}this.frame=wp.media({frame:"post",state:"gallery-edit",title:wp.media.view.l10n.editGalleryTitle,editing:true,multiple:true,selection:e}).open();return this.frame}}}());wp.media.featuredImage={get:function(){return wp.media.view.settings.post.featuredImageId},set:function(d){var c=wp.media.view.settings;c.post.featuredImageId=d;wp.media.post("set-post-thumbnail",{json:true,post_id:c.post.id,thumbnail_id:c.post.featuredImageId,_wpnonce:c.post.nonce}).done(function(e){b(".inside","#postimagediv").html(e)})},frame:function(){if(this._frame){return this._frame}this._frame=wp.media({state:"featured-image",states:[new wp.media.controller.FeaturedImage()]});this._frame.on("toolbar:create:featured-image",function(c){this.createSelectToolbar(c,{text:wp.media.view.l10n.setFeaturedImage})},this._frame);this._frame.state("featured-image").on("select",this.select);return this._frame},select:function(){var d=wp.media.view.settings,c=this.get("selection").single();if(!d.post.featuredImageId){return}wp.media.featuredImage.set(c?c.id:-1)},init:function(){b("#postimagediv").on("click","#set-post-thumbnail",function(c){c.preventDefault();c.stopPropagation();wp.media.featuredImage.frame().open()}).on("click","#remove-post-thumbnail",function(){wp.media.view.settings.post.featuredImageId=-1})}};b(wp.media.featuredImage.init);wp.media.editor={insert:function(g){var d=typeof(tinymce)!="undefined",j=typeof(QTags)!="undefined",c=window.wpActiveEditor,f;if(window.send_to_editor){return window.send_Line truncated
(function(b){var a={};wp.media.string={props:function(f,i){var h,c,e,g,d,j=wp.media.view.settings.defaultProps;d=function(k){if("image"===k.type&&!k.alt){k.alt=k.caption||k.title||"";k.alt=k.alt.replace(/<\/?[^>]+>/g,"");k.alt=k.alt.replace(/[\r\n]+/g," ")}return k};f=f?_.clone(f):{};if(i&&i.type){f.type=i.type}if("image"===f.type){f=_.defaults(f||{},{align:j.align||getUserSetting("align","none"),size:j.size||getUserSetting("imgsize","medium"),url:"",classes:[]})}if(!i){return d(f)}f.title=f.title||i.title;h=f.link||j.link||getUserSetting("urlbutton","file");if("file"===h){c=i.url}else{if("post"===h){c=i.link}else{if("custom"===h){c=f.linkUrl}}}f.linkUrl=c||"";if("image"===i.type){f.classes.push("wp-image-"+i.id);g=i.sizes;e=g&&g[f.size]?g[f.size]:i;_.extend(f,_.pick(i,"align","caption","alt"),{width:e.width,height:e.height,src:e.url,captionId:"attachment_"+i.id})}else{f.title=f.title||i.filename;f.rel=f.rel||"attachment wp-att-"+i.id}return d(f)},link:function(d,e){var c;d=wp.media.string.props(d,e);c={tag:"a",content:d.title,attrs:{href:d.linkUrl}};if(d.rel){c.attrs.rel=d.rel}return wp.html.string(c)},image:function(g,i){var c={},d,f,h,e;g=wp.media.string.props(g,i);f=g.classes||[];c.src=g.url;_.extend(c,_.pick(g,"width","height","alt"));if(g.align&&!g.caption){f.push("align"+g.align)}if(g.size){f.push("size-"+g.size)}c["class"]=_.compact(f).join(" ");d={tag:"img",attrs:c,single:true};if(g.linkUrl){d={tag:"a",attrs:{href:g.linkUrl},content:d}}e=wp.html.string(d);if(g.caption){h={};if(c.width){h.width=c.width}if(g.captionId){h.id=g.captionId}if(g.align){h.align="align"+g.align}e=wp.shortcode.string({tag:"caption",attrs:h,content:e+" "+g.caption})}return e}};wp.media.gallery=(function(){var c={};return{defaults:{order:"ASC",id:wp.media.view.settings.post.id,itemtag:"dl",icontag:"dt",captiontag:"dd",columns:"3",link:"post",size:"thumbnail",orderby:"menu_order ID"},attachments:function(h){var j=h.string(),d=c[j],f,e,i,g;delete c[j];if(d){return d}f=_.defaults(h.attrs.named,wp.media.gallery.defaults);e=_.pick(f,"orderby","order");e.type="image";e.perPage=-1;if("rand"===f.orderby){f._orderbyRandom=true}if(!f.orderby||/^menu_order(?: ID)?$/i.test(f.orderby)){e.orderby="menuOrder"}if(f.ids){e.post__in=f.ids.split(",");e.orderby="post__in"}else{if(f.include){e.post__in=f.include.split(",")}}if(f.exclude){e.post__not_in=f.exclude.split(",")}if(!e.post__in){e.uploadedTo=f.id}g=_.omit(f,"id","ids","include","exclude","orderby","order");i=wp.media.query(e);i.gallery=new Backbone.Model(g);return i},shortcode:function(d){var f=d.props.toJSON(),e=_.pick(f,"orderby","order"),g,h;if(d.gallery){_.extend(e,d.gallery.toJSON())}e.ids=d.pluck("id");if(f.uploadedTo){e.id=f.uploadedTo}if(e._orderbyRandom){e.orderby="rand"}delete e._orderbyRandom;if(e.ids&&"post__in"===e.orderby){delete e.orderby}_.each(wp.media.gallery.defaults,function(j,i){if(j===e[i]){delete e[i]}});g=new wp.shortcode({tag:"gallery",attrs:e,type:"single"});h=new wp.media.model.Attachments(d.models,{props:f});h.gallery=d.gallery;c[g.string()]=h;return g},edit:function(g){var f=wp.shortcode.next("gallery",g),h=wp.media.gallery.defaults.id,d,e;if(!f||f.content!==g){return}f=f.shortcode;if(_.isUndefined(f.get("id"))&&!_.isUndefined(h)){f.set("id",h)}d=wp.media.gallery.attachments(f);e=new wp.media.model.Selection(d.models,{props:d.props.toJSON(),multiple:true});e.gallery=d.gallery;e.more().done(function(){e.props.set({query:false});e.unmirror();e.props.unset("orderby")});if(this.frame){this.frame.dispose()}this.frame=wp.media({frame:"post",state:"gallery-edit",title:wp.media.view.l10n.editGalleryTitle,editing:true,multiple:true,selection:e}).open();return this.frame}}}());wp.media.featuredImage={get:function(){return wp.media.view.settings.post.featuredImageId},set:function(d){var c=wp.media.view.settings;c.post.featuredImageId=d;wp.media.post("set-post-thumbnail",{json:true,post_id:c.post.id,thumbnail_id:c.post.featuredImageId,_wpnonce:c.post.nonce}).done(function(e){b(".inside","#postimagediv").html(e)})},frame:function(){if(this._frame){return this._frame}this._frame=wp.media({state:"featured-image",states:[new wp.media.controller.FeaturedImage()]});this._frame.on("toolbar:create:featured-image",function(c){this.createSelectToolbar(c,{text:wp.media.view.l10n.setFeaturedImage})},this._frame);this._frame.state("featured-image").on("select",this.select);return this._frame},select:function(){var d=wp.media.view.settings,c=this.get("selection").single();if(!d.post.featuredImageId){return}wp.media.featuredImage.set(c?c.id:-1)},init:function(){b("#postimagediv").on("click","#set-post-thumbnail",function(c){c.preventDefault();c.stopPropagation();wp.media.featuredImage.frame().open()}).on("click","#remove-post-thumbnail",function(){wp.media.view.settings.post.featuredImageId=-1})}};b(wp.media.featuredImage.init);wp.media.editor={insert:function(g){var d=typeof(tinymce)!="undefined",j=typeof(QTags)!="undefined",c=window.wpActiveEditor,f;if(window.send_to_editor){return Line truncated
Loaded 100 of 118 files, more files were not shown because too many files have changed in this diff. Show more