Skip to content

Commit

Permalink
Merge branch 'master' of git://github.com/Yoast/wordpress-seo into Re…
Browse files Browse the repository at this point in the history
…factor-wpseo-replace-vars
  • Loading branch information
jrfnl committed May 28, 2014
2 parents 90d4f75 + 5c8683c commit 55da12d
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 14 deletions.
1 change: 1 addition & 0 deletions admin/class-metabox.php
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@ public function publish_box() {
if ( self::get_value( 'meta-robots-noindex' ) === '1' ) {
$score_label = 'noindex';
$title = __( 'Post is set to noindex.', 'wordpress-seo' );
$score_title = $title;
} else {
$score = self::get_value( 'linkdex' );
if ( $score !== '' ) {
Expand Down
2 changes: 2 additions & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -128,12 +128,14 @@ You'll find the [FAQ on Yoast.com](https://yoast.com/wordpress/plugins/seo/faq/)

* Enhancements
* We've added some options and some host specific info to our tracking class. Most notably, we're tracking the PHP version for our users now, so we can see whether we, at some point, might drop PHP 5.2 support before WordPress does.
* Auto-deactivate plugin in the rare case that the SPL (Standard PHP Library) extension is not available.

* Bugfixes
* Check whether snippet preview is shown on page before hiding / showing errors, deducted from [#1178](https://github.com/Yoast/wordpress-seo/issues/1178)
* Fixed incorrect sitemap last modified date as reported in [issue 1136](https://github.com/Yoast/wordpress-seo/issues/1136) - props [rscs](https://github.com/rscs).
* Specify post ID when using `wp_enqueue_media()` to set up correctly for the post being edited. [Pull #1165](https://github.com/Yoast/wordpress-seo/pull/1165), props [benhuson](https://github.com/benhuson).
* Fixed unreachable filter `wpseo_sitemap_[post_type]_content` as reported in [pull #1163](https://github.com/Yoast/wordpress-seo/pull/1163), also fixes unreachable filter `wpseo_sitemap_author_content`. Props [jakub-klapka](https://github.com/jakub-klapka).
* Fixed PHP notice as reported by [maxiwheat](https://github.com/maxiwheat) in [issue #1160](https://github.com/Yoast/wordpress-seo/issues/1160).

* i18n
* Make sure extensions menu is fully i18n compatible.
Expand Down
58 changes: 44 additions & 14 deletions wp-seo-main.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,9 @@ function wpseo_auto_load( $class ) {
require_once( $classes[$cn] );
}
}
spl_autoload_register( 'wpseo_auto_load' );
if( function_exists( 'spl_autoload_register' ) ) {
spl_autoload_register( 'wpseo_auto_load' );
}


/**
Expand Down Expand Up @@ -269,26 +271,54 @@ function wpseo_admin_init() {

}

add_action( 'plugins_loaded', 'wpseo_init', 14 );

if ( is_admin() ) {
if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {
require_once( WPSEO_PATH . 'admin/ajax.php' );
if ( ! function_exists( 'spl_autoload_register' ) ) {
add_action( 'admin_init', 'yoast_wpseo_self_deactivate', 1 );
}
else {
add_action( 'plugins_loaded', 'wpseo_init', 14 );

if ( is_admin() ) {
if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {
require_once( WPSEO_PATH . 'admin/ajax.php' );
}
else {
add_action( 'plugins_loaded', 'wpseo_admin_init', 15 );
}
}
else {
add_action( 'plugins_loaded', 'wpseo_admin_init', 15 );
add_action( 'plugins_loaded', 'wpseo_frontend_init', 15 );
}

add_action( 'admin_init', 'load_yoast_notifications' );
}
else {
add_action( 'plugins_loaded', 'wpseo_frontend_init', 15 );
}

// Activation and deactivation hook
register_activation_hook( WPSEO_FILE, 'wpseo_activate' );
register_deactivation_hook( WPSEO_FILE, 'wpseo_deactivate' );


function load_yoast_notifications() {
// Init Yoast_Notification_Center class
Yoast_Notification_Center::get();
}
add_action( 'admin_init', 'load_yoast_notifications' );

// Activation and deactivation hook
register_activation_hook( WPSEO_FILE, 'wpseo_activate' );
register_deactivation_hook( WPSEO_FILE, 'wpseo_deactivate' );

/**
* Throw an error if the PHP SPL extension is disabled (prevent white screens) and self-deactivate plugin
*
* @since 1.5.4
*
* @param string Error message
* @return void
*/
function yoast_wpseo_self_deactivate() {
if ( is_admin() ) {
$message = esc_html__( 'The Standard PHP Library (SPL) extension seem to be unavailable. Please ask your web host to enable it.', 'wordpress-seo' );
add_action( 'admin_notices', create_function( $message, 'echo \'<div class="error"><p>\' . __( \'Activation failed:\', \'wordpress-seo\' ) . \' \' . $message . \'</p></div>\';' ) );

deactivate_plugins( plugin_basename( WPSEO_FILE ) );
if ( isset( $_GET['activate'] ) ) {
unset( $_GET['activate'] );
}
}
}

0 comments on commit 55da12d

Please sign in to comment.