Version Description
- Fixed a potential conflict with other plugins that also utilize the Google API PHP library. The API is now only included if the Google_Client class does not already exist.
- Added additional checking during plugin activation to fail fast if the server does not meet the minimum plugin requirements.
Download this release
Release Info
Developer | mattkeys |
Plugin | Google Pagespeed Insights |
Version | 1.0.1 |
Comparing to | |
See all releases |
Code changes from version 1.0.0 to 1.0.1
- core/core.php +7 -3
- core/init.php +23 -2
- google-pagespeed-insights.php +2 -2
- includes/admin/options.php +1 -1
- readme.txt +18 -5
core/core.php
CHANGED
@@ -77,9 +77,13 @@ if (!class_exists('googlePagespeedInsights')) {
|
|
77 |
//Set last run finished to false, we will change this to true if this process finishes before max execution time.
|
78 |
$this->google_pagespeed_insights_Update_Options('last_run_finished',false,'gpagespeedi_options');
|
79 |
|
80 |
-
//Include Google API + Start new Instance
|
81 |
-
|
82 |
-
|
|
|
|
|
|
|
|
|
83 |
|
84 |
$client = new Google_Client();
|
85 |
$client->setApplicationName("Google_Pagespeed_Insights");
|
77 |
//Set last run finished to false, we will change this to true if this process finishes before max execution time.
|
78 |
$this->google_pagespeed_insights_Update_Options('last_run_finished',false,'gpagespeedi_options');
|
79 |
|
80 |
+
//Include Google API + Start new Instance. Check first to make sure they arent already included by another plugin!
|
81 |
+
if(!class_exists('Google_Client')) {
|
82 |
+
require_once GPI_DIRECTORY.'/google-api/src/Google_Client.php';
|
83 |
+
}
|
84 |
+
if(!class_exists('Google_PagespeedonlineService')) {
|
85 |
+
require_once GPI_DIRECTORY.'/google-api/src/contrib/Google_PagespeedonlineService.php';
|
86 |
+
}
|
87 |
|
88 |
$client = new Google_Client();
|
89 |
$client->setApplicationName("Google_Pagespeed_Insights");
|
core/init.php
CHANGED
@@ -10,10 +10,31 @@ if ( defined('GPI_ACTIVE') ){
|
|
10 |
define('GPI_ACTIVE', true);
|
11 |
|
12 |
//Fail fast if the WP version is unsupported. The $wp_version variable may be obfuscated by other
|
13 |
-
//plugins, so use function detection to determine the version.
|
14 |
if ( !function_exists('wp_editor') ){
|
15 |
trigger_error(
|
16 |
-
__('
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17 |
E_USER_ERROR
|
18 |
);
|
19 |
}
|
10 |
define('GPI_ACTIVE', true);
|
11 |
|
12 |
//Fail fast if the WP version is unsupported. The $wp_version variable may be obfuscated by other
|
13 |
+
//plugins, so use function detection to determine the version. wp_editor was introduced in WP 3.3
|
14 |
if ( !function_exists('wp_editor') ){
|
15 |
trigger_error(
|
16 |
+
__('Google PageSpeed Insights requires WordPress 3.3 or later!', 'gpagespeedi'),
|
17 |
+
E_USER_ERROR
|
18 |
+
);
|
19 |
+
}
|
20 |
+
|
21 |
+
if ( !function_exists('curl_init') ) {
|
22 |
+
trigger_error(
|
23 |
+
__('Google Pagespeed Insights requires the CURL PHP extension', 'gpagespeedi'),
|
24 |
+
E_USER_ERROR
|
25 |
+
);
|
26 |
+
}
|
27 |
+
|
28 |
+
if ( !function_exists('json_decode') ) {
|
29 |
+
trigger_error(
|
30 |
+
__('Google Pagespeed Insights requires the JSON PHP extension', 'gpagespeedi'),
|
31 |
+
E_USER_ERROR
|
32 |
+
);
|
33 |
+
}
|
34 |
+
|
35 |
+
if ( !function_exists('http_build_query') ) {
|
36 |
+
trigger_error(
|
37 |
+
__('Google Pagespeed Insights requires http_build_query()', 'gpagespeedi'),
|
38 |
E_USER_ERROR
|
39 |
);
|
40 |
}
|
google-pagespeed-insights.php
CHANGED
@@ -1,14 +1,14 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
* @package google_pagespeed_insights
|
4 |
-
* @version 1.0
|
5 |
*/
|
6 |
/*
|
7 |
Plugin Name: Google Pagespeed Insights
|
8 |
Plugin URI: http://mattkeys.me
|
9 |
Description: Google Pagespeed Insights
|
10 |
Author: Matt Keys
|
11 |
-
Version: 1.0
|
12 |
Author URI: http://mattkeys.me
|
13 |
*/
|
14 |
|
1 |
<?php
|
2 |
/**
|
3 |
* @package google_pagespeed_insights
|
4 |
+
* @version 1.0.1
|
5 |
*/
|
6 |
/*
|
7 |
Plugin Name: Google Pagespeed Insights
|
8 |
Plugin URI: http://mattkeys.me
|
9 |
Description: Google Pagespeed Insights
|
10 |
Author: Matt Keys
|
11 |
+
Version: 1.0.1
|
12 |
Author URI: http://mattkeys.me
|
13 |
*/
|
14 |
|
includes/admin/options.php
CHANGED
@@ -100,7 +100,7 @@ function gpi_render_options_page() {
|
|
100 |
<?php if($options['alt_pagespeed_scan']) { ?>
|
101 |
<p><?php _e('Settings Saved. Google Pagespeed Insights will now begin generating page reports. This page may appear to still be loading, however report generation will continue when you navigate away.', 'gpagespeedi'); ?></p>
|
102 |
<?php } else { ?>
|
103 |
-
<p><?php _e('Settings Saved. Google Pagespeed Insights will now begin generating page reports.', 'gpagespeedi'); ?></p>
|
104 |
<?php } ?>
|
105 |
</div>
|
106 |
<?php
|
100 |
<?php if($options['alt_pagespeed_scan']) { ?>
|
101 |
<p><?php _e('Settings Saved. Google Pagespeed Insights will now begin generating page reports. This page may appear to still be loading, however report generation will continue when you navigate away.', 'gpagespeedi'); ?></p>
|
102 |
<?php } else { ?>
|
103 |
+
<p><?php _e('Settings Saved. Google Pagespeed Insights will now begin generating page reports. Click the "Report List" tab to watch the progress', 'gpagespeedi'); ?></p>
|
104 |
<?php } ?>
|
105 |
</div>
|
106 |
<?php
|
readme.txt
CHANGED
@@ -20,10 +20,12 @@ Through the addition of advanced data visualization, tagging, filtering, and sna
|
|
20 |
|
21 |
Check out the [Premium Edition](http://mattkeys.me/products/google-pagespeed-insights/) to add even more powerful functionality including:
|
22 |
|
23 |
-
* Report Snapshots
|
24 |
-
* Snapshot Comparison Tool
|
25 |
-
* Add/Import Custom URLs
|
26 |
-
* Scheduled Report Checks
|
|
|
|
|
27 |
|
28 |
= Detailed Page Reporting =
|
29 |
|
@@ -129,4 +131,15 @@ Google Pagespeed Insights requires a Google API Key. Keys are free and can be ob
|
|
129 |
|
130 |
== Changelog ==
|
131 |
|
132 |
-
1.0.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
|
21 |
Check out the [Premium Edition](http://mattkeys.me/products/google-pagespeed-insights/) to add even more powerful functionality including:
|
22 |
|
23 |
+
* [Report Snapshots](http://mattkeys.me/products/google-pagespeed-insights/#report_snapshots)
|
24 |
+
* [Snapshot Comparison Tool](http://mattkeys.me/products/google-pagespeed-insights/#snapshot_comparison)
|
25 |
+
* [Add/Import Custom URLs](http://mattkeys.me/products/google-pagespeed-insights/#custom_urls)
|
26 |
+
* [Scheduled Report Checks](http://mattkeys.me/products/google-pagespeed-insights/#scheduled_checks)
|
27 |
+
|
28 |
+
[Compare the Free and Premium versions](http://mattkeys.me/products/google-pagespeed-insights/#compare_table)
|
29 |
|
30 |
= Detailed Page Reporting =
|
31 |
|
131 |
|
132 |
== Changelog ==
|
133 |
|
134 |
+
= 1.0.1 =
|
135 |
+
* Fixed a potential conflict with other plugins that also utilize the Google API PHP library. The API is now only included if the Google_Client class does not already exist.
|
136 |
+
* Added additional checking during plugin activation to fail fast if the server does not meet the minimum plugin requirements.
|
137 |
+
|
138 |
+
= 1.0.0 =
|
139 |
+
* Initial Release
|
140 |
+
|
141 |
+
== Upgrade Notice ==
|
142 |
+
|
143 |
+
= 1.0.1 =
|
144 |
+
This version fixes a potential conflict with other Wordpress plugins that are also using the Google API PHP library.
|
145 |
+
|