Google Pagespeed Insights - Version 1.0.3

Version Description

  • Tweaked interactions with WPDB so that it will properly get the table prefix for WordPress multisite installations.
Download this release

Release Info

Developer mattkeys
Plugin Icon 128x128 Google Pagespeed Insights
Version 1.0.3
Comparing to
See all releases

Code changes from version 1.0.2 to 1.0.3

core/core.php CHANGED
@@ -352,7 +352,7 @@ if (!class_exists('googlePagespeedInsights')) {
352
 
353
  global $wpdb;
354
 
355
- $gpi_page_blacklist = $wpdb->base_prefix . 'gpi_page_blacklist';
356
  $query = "
357
  SELECT URL
358
  FROM $gpi_page_blacklist
352
 
353
  global $wpdb;
354
 
355
+ $gpi_page_blacklist = $wpdb->prefix . 'gpi_page_blacklist';
356
  $query = "
357
  SELECT URL
358
  FROM $gpi_page_blacklist
documentation/assets/images/api_key_1.png ADDED
Binary file
documentation/assets/images/api_key_10.png ADDED
Binary file
documentation/assets/images/api_key_11.png ADDED
Binary file
documentation/assets/images/api_key_12.png ADDED
Binary file
documentation/assets/images/api_key_2.png ADDED
Binary file
documentation/assets/images/api_key_3.png ADDED
Binary file
documentation/assets/images/api_key_5.png ADDED
Binary file
documentation/assets/images/api_key_6.png ADDED
Binary file
documentation/assets/images/api_key_7.png ADDED
Binary file
documentation/assets/images/api_key_8.png ADDED
Binary file
documentation/assets/images/api_key_9.png ADDED
Binary file
documentation/assets/images/google-api-create-enable.png DELETED
Binary file
documentation/assets/images/google-api-create-project.png DELETED
Binary file
documentation/assets/images/google-api-key.png DELETED
Binary file
documentation/index.html CHANGED
@@ -17,7 +17,7 @@
17
  <body>
18
  <div class="container">
19
 
20
- <h3 class="center alt">Google Pagespeed Insights for Wordpress v1.0 Documentation by Matt Keys</h3>
21
 
22
  <hr>
23
 
@@ -32,6 +32,7 @@
32
  <p class="prepend-top">
33
  <strong>
34
  Created: 09/28/2013<br>
 
35
  By: Matt Keys<br>
36
  <a href="http://mattkeys.me">mattkeys.me</a>
37
  </strong>
@@ -49,7 +50,7 @@
49
  <ol class="alpha">
50
  <li><a href="#overview">Overview</a></li>
51
  <li><a href="#installation">Installation</a></li>
52
- <li><a href="#required_configuration">Required Configuration</a></li>
53
  <li><a href="#recommended_configuration">Recommended Configuration</a></li>
54
  <li><a href="#view_reports">Report List</a></li>
55
  <li><a href="#report_summary">Report Summary</a></li>
@@ -86,27 +87,47 @@
86
 
87
  <h4 style="color: red; font-weight: bold;">Required - Obtain and Enter a Google API Key:</h4>
88
 
89
- <p>Google API Key's are free, and can be obtained from Google. In order to get a key, you will need a Google account such as a GMail account. If you do not already have a Google account you can create one here: <a href="https://accounts.google.com/SignUp" target="_blank">https://accounts.google.com/SignUp</a>.
90
- <ol>
91
- <li>Navigate to <a href="https://code.google.com/apis/console" target="_blank">https://code.google.com/apis/console</a></li>
92
- <li>Login with your Google Account (<a href="https://accounts.google.com/SignUp" target="_blank">Create a Google account</a> if you do not have one)</li>
93
- <li>Click the "Create Project..." button<br />
94
- <br /><img src="assets/images/google-api-create-project.png" alt="Google API Create Project" /></li><br />
95
- <li>You should now be looking at the "Services" page, if you are not, click "Services" from the menu on the left.</li>
96
- <li>Scroll down the Services page until you find "PageSpeed Insights API". Click the Switch to turn it on. You must agree to Google's Terms and Conditions to continue.<br />
97
- <br /><img src="assets/images/google-api-create-enable.png" alt="Google API Enable API" /></li><br />
98
- <li>After enabling the API, navigate to the "API Access" page from the left menu. Your API Key can be found under "Simple API Access." Copy this key to your clipboard.<br />
99
- <br /><img src="assets/images/google-api-key.png" alt="Google API Key" /></li><br />
100
- <li>Paste this API Key into the Options page of Google Pagespeed Insights for Wordpress<br />
101
- <br /><img src="assets/images/gpi_options.png" alt="GPI Options" /></li><br />
102
- </ol>
103
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
104
  <hr>
105
 
106
  <h3 id="recommended_configuration"><strong>D) Recommended Configuration</strong> - <a href="#toc">top</a></h3>
107
 
108
  <br />
109
- <img src="assets/images/configure2.png" alt="Recommended Configuration" /></li>
110
  <br />
111
 
112
  <p>The following items are not required, but it is recommended that you review them to match their options to your preferences</p>
17
  <body>
18
  <div class="container">
19
 
20
+ <h3 class="center alt">Google Pagespeed Insights for Wordpress v1.03 Documentation by Matt Keys</h3>
21
 
22
  <hr>
23
 
32
  <p class="prepend-top">
33
  <strong>
34
  Created: 09/28/2013<br>
35
+ Updated: 02/03/2014<br>
36
  By: Matt Keys<br>
37
  <a href="http://mattkeys.me">mattkeys.me</a>
38
  </strong>
50
  <ol class="alpha">
51
  <li><a href="#overview">Overview</a></li>
52
  <li><a href="#installation">Installation</a></li>
53
+ <li><a href="#required_configuration"><font style="color: red;">Required Configuration (Google API Key)</font></a></li>
54
  <li><a href="#recommended_configuration">Recommended Configuration</a></li>
55
  <li><a href="#view_reports">Report List</a></li>
56
  <li><a href="#report_summary">Report Summary</a></li>
87
 
88
  <h4 style="color: red; font-weight: bold;">Required - Obtain and Enter a Google API Key:</h4>
89
 
90
+ <p>Google API Key's are free, and can be obtained from Google. In order to get a key, you will need a Google account such as a GMail account. If you do not already have a Google account you can create one here: <a href="https://accounts.google.com/SignUp" target="_blank">https://accounts.google.com/SignUp</a>.</p>
 
 
 
 
 
 
 
 
 
 
 
 
 
91
 
92
+ <div style="text-align:center"><img style="border: 1px solid #ccc;" src="assets/images/api_key_1.png" alt="" /></div>
93
+ <p>Navigate to <a href="http://code.google.com/apis/console" target="_blank">http://code.google.com/apis/console</a>. If you are not already logged into your google account, log in now. Once logged in you should see the "create project" button. If you have already created a project you can skip ahead to enabling the PageSpeed Insights API.</p>
94
+
95
+ <div style="text-align:center"><img style="border: 1px solid #ccc;" src="assets/images/api_key_2.png" alt="" /></div>
96
+ <p>Google will have automaticly generated a Project name and Project ID for you. You can leave these as-is. You must agree to google's Terms of Service, then click "create".
97
+
98
+ <div style="text-align:center"><img style="border: 1px solid #ccc;" src="assets/images/api_key_3.png" alt="" /></div>
99
+ <p>If this is a new account, google may require you to verify you are not a spammer by having them call or text your phone. You will be given a verification number that you must enter on the next screen to continue.</p>
100
+
101
+ <div style="text-align:center"><img style="border: 1px solid #ccc;" src="assets/images/api_key_5.png" alt="" /></div>
102
+ <p>If you had to verify your account, you will be directed back to this screen after verification, click create to continue.</p>
103
+
104
+ <div style="text-align:center"><img style="border: 1px solid #ccc;" src="assets/images/api_key_6.png" alt="" /></div>
105
+ <p>Google will now create your project, it took about 20 seconds or so on my computer until the project creation finished. After your project has been created, you can enable the google services you want to use. Find "PageSpeed Insights API" in the list, and click it.</p>
106
+
107
+ <div style="text-align:center"><img style="border: 1px solid #ccc;" src="assets/images/api_key_7.png" alt="" /></div>
108
+ <p>You must accept Google's Terms of Service to continue.</p>
109
+
110
+ <div style="text-align:center"><img style="border: 1px solid #ccc;" src="assets/images/api_key_8.png" alt="" /></div>
111
+ <p>Click the "Credentials" menu item from the left to move on to the API key creation. Click "Create New Key" under the Public API access area.</p>
112
+
113
+ <div style="text-align:center"><img style="border: 1px solid #ccc;" src="assets/images/api_key_9.png" alt="" /></div>
114
+ <p>Select "Browser key" from the key types.</p>
115
+
116
+ <div style="text-align:center"><img style="border: 1px solid #ccc;" src="assets/images/api_key_10.png" alt="" /></div>
117
+ <p>Google will ask you if you would like to limit the domains that are allowed to interact with this API key. This is optional, and I leave this field blank. Click Create to continue.</p>
118
+
119
+ <div style="text-align:center"><img style="border: 1px solid #ccc;" src="assets/images/api_key_11.png" alt="" /></div>
120
+ <p>You will now see the Alpha-Numeric API Key which we will need for the last step. Copy this key.</p>
121
+
122
+ <div style="text-align:center"><img style="border: 1px solid #ccc;" src="assets/images/api_key_12.png" alt="" /></div>
123
+ <p>Paste your API key into the Google Pagespeed Insights plugin, and Save.</p>
124
+
125
  <hr>
126
 
127
  <h3 id="recommended_configuration"><strong>D) Recommended Configuration</strong> - <a href="#toc">top</a></h3>
128
 
129
  <br />
130
+ <img src="assets/images/configure2.png" alt="Recommended Configuration" />
131
  <br />
132
 
133
  <p>The following items are not required, but it is recommended that you review them to match their options to your preferences</p>
google-pagespeed-insights.php CHANGED
@@ -1,14 +1,14 @@
1
  <?php
2
  /**
3
  * @package google_pagespeed_insights
4
- * @version 1.0.2
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.2
12
  Author URI: http://mattkeys.me
13
  */
14
 
1
  <?php
2
  /**
3
  * @package google_pagespeed_insights
4
+ * @version 1.0.3
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.3
12
  Author URI: http://mattkeys.me
13
  */
14
 
includes/actions/activate.php CHANGED
@@ -7,7 +7,7 @@ if(!defined('GPI_DIRECTORY')) {
7
  function gpi_action_activate_page($page_id, $page_report){
8
 
9
  global $wpdb;
10
- $gpi_page_blacklist = $wpdb->base_prefix . 'gpi_page_blacklist';
11
 
12
  if(is_array($page_report) && !empty($page_report)) {
13
 
7
  function gpi_action_activate_page($page_id, $page_report){
8
 
9
  global $wpdb;
10
+ $gpi_page_blacklist = $wpdb->prefix . 'gpi_page_blacklist';
11
 
12
  if(is_array($page_report) && !empty($page_report)) {
13
 
includes/actions/ignore.php CHANGED
@@ -6,9 +6,9 @@ if(!defined('GPI_DIRECTORY')) {
6
 
7
  function gpi_action_ignore_page($page_id, $page_report){
8
  global $wpdb;
9
- $gpi_page_stats = $wpdb->base_prefix . 'gpi_page_stats';
10
- $gpi_page_reports = $wpdb->base_prefix . 'gpi_page_reports';
11
- $gpi_page_blacklist = $wpdb->base_prefix . 'gpi_page_blacklist';
12
 
13
  if(is_array($page_report) && !empty($page_report)) {
14
  // Build our where clauses for selecting and deleting URLs
6
 
7
  function gpi_action_ignore_page($page_id, $page_report){
8
  global $wpdb;
9
+ $gpi_page_stats = $wpdb->prefix . 'gpi_page_stats';
10
+ $gpi_page_reports = $wpdb->prefix . 'gpi_page_reports';
11
+ $gpi_page_blacklist = $wpdb->prefix . 'gpi_page_blacklist';
12
 
13
  if(is_array($page_report) && !empty($page_report)) {
14
  // Build our where clauses for selecting and deleting URLs
includes/actions/recheck.php CHANGED
@@ -7,7 +7,7 @@ if(!defined('GPI_DIRECTORY')) {
7
  function gpi_action_recheck_page($page_id, $page_report){
8
 
9
  global $wpdb;
10
- $gpi_page_stats = $wpdb->base_prefix . 'gpi_page_stats';
11
 
12
  if(is_array($page_report) && !empty($page_report)) {
13
 
7
  function gpi_action_recheck_page($page_id, $page_report){
8
 
9
  global $wpdb;
10
+ $gpi_page_stats = $wpdb->prefix . 'gpi_page_stats';
11
 
12
  if(is_array($page_report) && !empty($page_report)) {
13
 
includes/actions/single-recheck.php CHANGED
@@ -10,7 +10,7 @@ function gpi_action_single_recheck_page($page_id){
10
 
11
  // If we are going to recheck this data, now is the time to do it
12
  if(!empty($page_id)) {
13
- $gpi_page_stats = $wpdb->base_prefix . 'gpi_page_stats';
14
  $query = "
15
  SELECT URL, type, object_id, term_id
16
  FROM $gpi_page_stats
10
 
11
  // If we are going to recheck this data, now is the time to do it
12
  if(!empty($page_id)) {
13
+ $gpi_page_stats = $wpdb->prefix . 'gpi_page_stats';
14
  $query = "
15
  SELECT URL, type, object_id, term_id
16
  FROM $gpi_page_stats
includes/admin/details.php CHANGED
@@ -21,7 +21,7 @@ function gpi_render_details_page($default_strategy, $page_id){
21
  $last_checked_column = $strategy . '_last_modified';
22
 
23
  if(!empty($page_id)) {
24
- $gpi_page_stats = $wpdb->base_prefix . 'gpi_page_stats';
25
  $query = "
26
  SELECT *
27
  FROM $gpi_page_stats
@@ -54,7 +54,7 @@ function gpi_render_details_page($default_strategy, $page_id){
54
  }
55
  }
56
 
57
- $gpi_page_reports = $wpdb->base_prefix . 'gpi_page_reports';
58
  $query2 = "
59
  SELECT rule_key, rule_name, rule_impact, rule_blocks
60
  FROM $gpi_page_reports
21
  $last_checked_column = $strategy . '_last_modified';
22
 
23
  if(!empty($page_id)) {
24
+ $gpi_page_stats = $wpdb->prefix . 'gpi_page_stats';
25
  $query = "
26
  SELECT *
27
  FROM $gpi_page_stats
54
  }
55
  }
56
 
57
+ $gpi_page_reports = $wpdb->prefix . 'gpi_page_reports';
58
  $query2 = "
59
  SELECT rule_key, rule_name, rule_impact, rule_blocks
60
  FROM $gpi_page_reports
includes/admin/options.php CHANGED
@@ -142,6 +142,7 @@ function gpi_render_options_page() {
142
  <p><?php _e('Google API Key:', 'gpagespeedi'); ?></p>
143
  <input type="text" name="google_developer_key" id="google_developer_key" value="<?php echo $options['google_developer_key'];?>" class="googleapi code" />
144
  <p class="description"><span style="color:red;"><?php _e('This is required', 'gpagespeedi'); ?></span>: <?php _e('if you do not have an API key you can create a new one for free from', 'gpagespeedi'); ?>: <a href="https://code.google.com/apis/console" target="_blank">https://code.google.com/apis/console</a></p>
 
145
 
146
  <p><?php _e('Google Response Language:', 'gpagespeedi'); ?></p>
147
  <select name="response_language" id="response_language">
142
  <p><?php _e('Google API Key:', 'gpagespeedi'); ?></p>
143
  <input type="text" name="google_developer_key" id="google_developer_key" value="<?php echo $options['google_developer_key'];?>" class="googleapi code" />
144
  <p class="description"><span style="color:red;"><?php _e('This is required', 'gpagespeedi'); ?></span>: <?php _e('if you do not have an API key you can create a new one for free from', 'gpagespeedi'); ?>: <a href="https://code.google.com/apis/console" target="_blank">https://code.google.com/apis/console</a></p>
145
+ <p class="description"><?php _e('If you need help creating an API key, please see the documentation included with this plugin.', 'gpagespeedi'); ?>: <a href="http://mattkeys.me/documentation/google-pagespeed-insights/" target="_blank">Documentation</a></p>
146
 
147
  <p><?php _e('Google Response Language:', 'gpagespeedi'); ?></p>
148
  <select name="response_language" id="response_language">
includes/admin/summary.php CHANGED
@@ -31,7 +31,7 @@ function gpi_render_summary_page($default_strategy) {
31
 
32
  // Page Data Query
33
  $data_typestocheck = $GPI_ListTable->getTypesToCheck($filter);
34
- $gpi_page_stats = $wpdb->base_prefix . 'gpi_page_stats';
35
  if(!empty($data_typestocheck)) {
36
 
37
  $allpagedata = $wpdb->get_results(
@@ -49,7 +49,7 @@ function gpi_render_summary_page($default_strategy) {
49
 
50
  // Page Reports Query
51
  $reports_typestocheck = $GPI_ListTable->getTypesToCheck($filter);
52
- $gpi_page_reports = $wpdb->base_prefix . 'gpi_page_reports';
53
 
54
  if(!empty($reports_typestocheck)) {
55
 
31
 
32
  // Page Data Query
33
  $data_typestocheck = $GPI_ListTable->getTypesToCheck($filter);
34
+ $gpi_page_stats = $wpdb->prefix . 'gpi_page_stats';
35
  if(!empty($data_typestocheck)) {
36
 
37
  $allpagedata = $wpdb->get_results(
49
 
50
  // Page Reports Query
51
  $reports_typestocheck = $GPI_ListTable->getTypesToCheck($filter);
52
+ $gpi_page_reports = $wpdb->prefix . 'gpi_page_reports';
53
 
54
  if(!empty($reports_typestocheck)) {
55
 
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: mattkeys
3
  Donate link: http://mattkeys.me/
4
  Tags: SEO, seo, performance, speed, google, search engine optimization, pagespeed, google page speed, page speed, pagespeed insights, google pagespeed insights
5
  Requires at least: 3.3
6
- Tested up to: 3.8
7
  Stable tag: trunk
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -131,6 +131,9 @@ Google Pagespeed Insights requires a Google API Key. Keys are free and can be ob
131
 
132
  == Changelog ==
133
 
 
 
 
134
  = 1.0.2 =
135
  * Tweaked styles to look better in the new WordPress 3.8 admin theme.
136
  * Fixed accidental use of some php shorttags (<? instead of <?php) that was causing activation errors for some. (Thank you bekar09 for first finding this error)
@@ -147,6 +150,9 @@ Google Pagespeed Insights requires a Google API Key. Keys are free and can be ob
147
 
148
  == Upgrade Notice ==
149
 
 
 
 
150
  = 1.0.2 =
151
  Added better style support for Wordpress 3.8. Fixed a handful of bugs that were creating PHP notices and in some cases preventing activation.
152
 
3
  Donate link: http://mattkeys.me/
4
  Tags: SEO, seo, performance, speed, google, search engine optimization, pagespeed, google page speed, page speed, pagespeed insights, google pagespeed insights
5
  Requires at least: 3.3
6
+ Tested up to: 3.9
7
  Stable tag: trunk
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
131
 
132
  == Changelog ==
133
 
134
+ = 1.0.3 =
135
+ * Tweaked interactions with WPDB so that it will properly get the table prefix for WordPress multisite installations.
136
+
137
  = 1.0.2 =
138
  * Tweaked styles to look better in the new WordPress 3.8 admin theme.
139
  * Fixed accidental use of some php shorttags (<? instead of <?php) that was causing activation errors for some. (Thank you bekar09 for first finding this error)
150
 
151
  == Upgrade Notice ==
152
 
153
+ = 1.0.3 =
154
+ Adding Support for WordPress Multisite
155
+
156
  = 1.0.2 =
157
  Added better style support for Wordpress 3.8. Fixed a handful of bugs that were creating PHP notices and in some cases preventing activation.
158