Merge with branch01

This commit is contained in:
ruben- 2016-04-27 21:54:28 +02:00
parent f586639d8b
commit c232857821
9 changed files with 516 additions and 488 deletions

View file

@ -132,7 +132,10 @@ class MainWP_Child_Pagespeed {
function save_settings() {
$current_values = get_option( 'gpagespeedi_options' );
if ( is_array( $current_values ) && false === $current_values['last_run_finished'] ) {
require_once GPI_DIRECTORY . '/core/core.php';
$googlePagespeedInsights = new googlePagespeedInsights( $current_values );
$worker_status = $googlePagespeedInsights->google_pagespeed_insights_Check_Status();
if ( $worker_status ) {
return array( 'result' => 'RUNNING' );
}
@ -229,13 +232,13 @@ class MainWP_Child_Pagespeed {
function do_check_pages($forceRecheck = false) {
if ( defined( 'GPI_DIRECTORY' ) ) {
$options = get_option( 'gpagespeedi_options' );
require_once GPI_DIRECTORY . '/core/core.php';
$googlePagespeedInsights = new googlePagespeedInsights( $options );
if ( $googlePagespeedInsights ) {
$googlePagespeedInsights->googlepagespeedinsightsworker( array(), true, $forceRecheck );
return true;
}
$options = get_option( 'gpagespeedi_options' );
require_once GPI_DIRECTORY . '/core/core.php';
$googlePagespeedInsights = new googlePagespeedInsights( $options );
if ( $googlePagespeedInsights ) {
$googlePagespeedInsights->googlepagespeedinsightsworker( array(), true, $forceRecheck );
return true;
}
}
return false;
}
@ -244,9 +247,12 @@ class MainWP_Child_Pagespeed {
if ( empty( $strategy ) ) {
$strategy = 'both';
}
$current_values = get_option( 'gpagespeedi_options' );
if ( is_array( $current_values ) && false === $current_values['last_run_finished'] ) {
$current_values = get_option( 'gpagespeedi_options' );
require_once GPI_DIRECTORY . '/core/core.php';
$googlePagespeedInsights = new googlePagespeedInsights( $current_values );
$worker_status = $googlePagespeedInsights->google_pagespeed_insights_Check_Status();
if ( $worker_status ) {
return array( 'result' => 'RUNNING' );
}