W3 Total Cache - Version 0.9.5.1

Version Description

  • Fixed missing namespace, which caused issues with other implementations of Google APIs
  • Fixed handling Cloudflare zone list being incomplete for users with many zones
  • Added extension to support Accelerated Mobile Pages (AMP)
  • Added notification for users that are still using PHP 5.2 (end of life in 2011)
  • Improved default settings
  • Improved compatibility with Yoast SEO sitemap caching
  • Improved compatability with Jetpack
  • Improved directory handling on IIS
  • Improved backwards compatibility for 3rd party implementations against legacy W3TC functions
Download this release

Release Info

Developer fredericktownes
Plugin Icon 128x128 W3 Total Cache
Version 0.9.5.1
Comparing to
See all releases

Code changes from version 0.9.5 to 0.9.5.1

Files changed (154) hide show
  1. BrowserCache_ConfigLabels.php +1 -1
  2. BrowserCache_Environment.php +2 -2
  3. BrowserCache_Plugin.php +2 -2
  4. CacheFlush_Locally.php +3 -1
  5. CdnEngine_Base.php +1 -1
  6. CdnEngine_GoogleDrive.php +16 -14
  7. Cdn_GoogleDrive_AdminActions.php +4 -4
  8. Cdn_GoogleDrive_Popup_AuthReturn.php +2 -2
  9. ConfigKeys.php +1 -1
  10. Extension_Amp_Plugin.php +63 -0
  11. Extension_Amp_Plugin_Admin.php +32 -0
  12. Extension_CloudFlare_Api.php +58 -3
  13. Extension_CloudFlare_Page_View.js +13 -0
  14. Extension_CloudFlare_Page_View.php +60 -65
  15. Extension_CloudFlare_Plugin.php +5 -1
  16. Extension_CloudFlare_Plugin_Admin.php +1 -0
  17. Extension_CloudFlare_Popup.php +16 -10
  18. Extension_CloudFlare_Popup_View_Zones.php +17 -1
  19. Extension_CloudFlare_Widget.php +2 -1
  20. Extension_CloudFlare_Widget_Logo.png +0 -0
  21. Extension_CloudFlare_Widget_View.css +8 -0
  22. Extension_FeedBurner_Page_View.php +2 -2
  23. Extension_FeedBurner_Plugin_Admin.php +1 -0
  24. Extension_FragmentCache_Api.php +2 -4
  25. Extension_FragmentCache_Plugin_Admin.php +1 -0
  26. Extension_FragmentCache_WpObjectCache.php +2 -2
  27. Extension_Genesis_Plugin_Admin.php +2 -1
  28. Extension_NewRelic_Page_View_Apm.php +3 -3
  29. Extension_NewRelic_Plugin_Admin.php +1 -0
  30. Extension_WordPressSeo_Plugin_Admin.php +3 -2
  31. Extension_Wpml_Plugin_Admin.php +6 -5
  32. Extensions_Page.php +14 -1
  33. Extensions_Plugin_Admin.php +4 -0
  34. Generic_ConfigLabels.php +1 -1
  35. Generic_Page_Dashboard_View.css +7 -5
  36. Generic_Plugin_Admin.php +3 -0
  37. Generic_Plugin_AdminNotifications.php +1 -1
  38. Generic_Plugin_WidgetServices.php → Generic_WidgetServices.php +65 -90
  39. Generic_WidgetServices_View.php +35 -0
  40. Generic_WidgetSpreadTheWord_Plugin.php +3 -3
  41. Licensing_AdminActions.php +4 -4
  42. Licensing_Core.php +105 -0
  43. Licensing_Plugin_Admin.php +5 -5
  44. Minify_ConfigLabels.php +1 -1
  45. Minify_Environment.php +3 -3
  46. Minify_MinifiedFileRequestHandler.php +8 -2
  47. Minify_Plugin.php +164 -153
  48. ObjectCache_WpObjectCache_Regular.php +2 -2
  49. PgCache_ConfigLabels.php +5 -5
  50. PgCache_ContentGrabber.php +1 -1
  51. PgCache_Environment.php +3 -3
  52. PgCache_Plugin_Admin.php +1 -1
  53. Root_Loader.php +6 -1
  54. Support_Page.php +28 -0
  55. Support_Page_View_PageContent.php +8 -1
  56. SystemOpCache_GeneralPage_View.php +1 -1
  57. UsageStatistics_ConfigLabels.php +0 -10
  58. UsageStatistics_Plugin_Admin.php +0 -3
  59. UsageStatistics_View_General.php +14 -4
  60. UsageStatistics_Widget.php +5 -2
  61. UsageStatistics_Widget_View_Disabled.php +1 -1
  62. Util_Environment.php +10 -10
  63. Util_PageUrls.php +1 -1
  64. Util_Rule.php +9 -7
  65. Util_UsageStatistics.php +0 -10
  66. changelog.txt +1 -1
  67. extension-example/Extension_Example_Admin.php +1 -0
  68. inc/define.php +5 -17
  69. inc/lightbox/cdn_s3_bucket_location.php +1 -3
  70. inc/lightbox/edge.php +1 -1
  71. inc/lightbox/self_test.php +1 -1
  72. inc/lightbox/support_us.php +1 -1
  73. inc/lightbox/upgrade.php +28 -22
  74. inc/options/about.php +1 -1
  75. inc/options/browsercache.php +8 -9
  76. inc/options/dashboard.php +1 -1
  77. inc/options/dbcache.php +1 -1
  78. inc/options/extensions/list.php +10 -7
  79. inc/options/general.php +1 -1
  80. inc/options/pgcache.php +8 -8
  81. inc/widget/services.php +0 -19
  82. languages/faq-en_US.xml +8 -57
  83. languages/faq-pro-en_US.xml +93 -55
  84. lib/CSSTidy/class.csstidy.php +1 -1
  85. lib/CSSTidy/class.csstidy_optimise.php +1 -1
  86. lib/CSSTidy/class.csstidy_print.php +1 -1
  87. lib/EDD/EDD_SL_Plugin_Updater.php +0 -139
  88. lib/EDD/integration.php +0 -100
  89. lib/Google/Auth/Abstract.php +5 -5
  90. lib/Google/Auth/AppIdentity.php +7 -7
  91. lib/Google/Auth/AssertionCredentials.php +6 -6
  92. lib/Google/Auth/Exception.php +1 -1
  93. lib/Google/Auth/LoginTicket.php +3 -3
  94. lib/Google/Auth/OAuth2.php +49 -49
  95. lib/Google/Auth/Simple.php +6 -6
  96. lib/Google/Cache/Abstract.php +2 -2
  97. lib/Google/Cache/Apc.php +4 -4
  98. lib/Google/Cache/Exception.php +1 -1
  99. lib/Google/Cache/File.php +4 -4
  100. lib/Google/Cache/Memcache.php +7 -7
  101. lib/Google/Cache/Null.php +2 -2
  102. lib/Google/Client.php +42 -42
  103. lib/Google/Collection.php +2 -2
  104. lib/Google/Config.php +10 -10
  105. lib/Google/Exception.php +1 -1
  106. lib/Google/Http/Batch.php +10 -10
  107. lib/Google/Http/CacheParser.php +10 -10
  108. lib/Google/Http/MediaFileUpload.php +10 -10
  109. lib/Google/Http/REST.php +11 -11
  110. lib/Google/Http/Request.php +3 -3
  111. lib/Google/IO/Abstract.php +27 -27
  112. lib/Google/IO/Curl.php +8 -8
  113. lib/Google/IO/Exception.php +1 -1
  114. lib/Google/IO/Stream.php +8 -8
  115. lib/Google/Model.php +7 -7
  116. lib/Google/Service.php +4 -4
  117. lib/Google/Service/Drive.php +281 -281
  118. lib/Google/Service/Exception.php +1 -1
  119. lib/Google/Service/Oauth2.php +20 -20
  120. lib/Google/Service/Resource.php +12 -12
  121. lib/Google/Signer/Abstract.php +1 -1
  122. lib/Google/Signer/P12.php +7 -7
  123. lib/Google/Utils.php +1 -1
  124. lib/Google/Utils/URITemplate.php +1 -1
  125. lib/Google/Verifier/Abstract.php +1 -1
  126. lib/Google/Verifier/Pem.php +7 -7
  127. lib/Minify/HTTP/ConditionalGet.php +1 -1
  128. lib/Nusoap/class.nusoap_base.php +1 -1
  129. lib/Nusoap/class.soap_fault.php +1 -1
  130. lib/Nusoap/class.soap_parser.php +1 -1
  131. lib/Nusoap/class.soap_transport_http.php +1 -1
  132. lib/Nusoap/class.soap_val.php +1 -1
  133. lib/Nusoap/class.soapclient.php +1 -1
  134. lib/Nusoap/class.wsdl.php +1 -1
  135. lib/Nusoap/class.wsdlcache.php +1 -1
  136. lib/Nusoap/class.xmlschema.php +1 -1
  137. lib/Nusoap/nusoap.php +9 -9
  138. lib/S3.php +30 -30
  139. lib/SNS/sdk.class.php +2 -2
  140. pub/css/lightbox.css +59 -37
  141. pub/css/options.css +11 -7
  142. pub/css/widget.css +4 -7
  143. pub/js/lightbox.js +9 -7
  144. pub/js/options.js +10 -0
  145. pub/js/widget.js +5 -24
  146. pub/opcache.php +1 -1
  147. pub/sns.php +1 -1
  148. readme.txt +42 -37
  149. w3-total-cache-api.php +70 -15
  150. w3-total-cache-old-php.php +32 -0
  151. w3-total-cache.php +8 -7
  152. wp-content/advanced-cache.php +1 -1
  153. wp-content/db.php +1 -1
  154. wp-content/object-cache.php +1 -1
BrowserCache_ConfigLabels.php CHANGED
@@ -13,7 +13,7 @@ class BrowserCache_ConfigLabels {
13
  'browsercache.cssjs.lifetime' => __( 'Expires header lifetime:', 'w3-total-cache' ),
14
  'browsercache.cssjs.cache.control' => __( 'Set cache control header', 'w3-total-cache' ),
15
  'browsercache.cssjs.cache.policy' => __( 'Cache Control policy:', 'w3-total-cache' ),
16
- 'browsercache.cssjs.etag' => __( 'Set entity tag (ETag)', 'w3-total-cache' ),
17
  'browsercache.cssjs.w3tc' => __( 'Set W3 Total Cache header', 'w3-total-cache' ),
18
  'browsercache.cssjs.compression' => __( 'Enable <acronym title="Hypertext Transfer Protocol">HTTP</acronym> (gzip) compression', 'w3-total-cache' ),
19
  'browsercache.cssjs.replace' => __( 'Prevent caching of objects after settings change', 'w3-total-cache' ),
13
  'browsercache.cssjs.lifetime' => __( 'Expires header lifetime:', 'w3-total-cache' ),
14
  'browsercache.cssjs.cache.control' => __( 'Set cache control header', 'w3-total-cache' ),
15
  'browsercache.cssjs.cache.policy' => __( 'Cache Control policy:', 'w3-total-cache' ),
16
+ 'browsercache.cssjs.etag' => __( 'Set entity tag (eTag)', 'w3-total-cache' ),
17
  'browsercache.cssjs.w3tc' => __( 'Set W3 Total Cache header', 'w3-total-cache' ),
18
  'browsercache.cssjs.compression' => __( 'Enable <acronym title="Hypertext Transfer Protocol">HTTP</acronym> (gzip) compression', 'w3-total-cache' ),
19
  'browsercache.cssjs.replace' => __( 'Prevent caching of objects after settings change', 'w3-total-cache' ),
BrowserCache_Environment.php CHANGED
@@ -462,7 +462,7 @@ class BrowserCache_Environment {
462
 
463
  if ( $w3tc )
464
  $headers_rules .= " Header set X-Powered-By \"" .
465
- Util_Environment::w3tc_header( $config ) . "\"\n";
466
 
467
  if ( strlen( $headers_rules ) > 0 ) {
468
  $rules .= " <IfModule mod_headers.c>\n";
@@ -643,7 +643,7 @@ class BrowserCache_Environment {
643
 
644
  if ( $w3tc ) {
645
  $add_header_rules .= " add_header X-Powered-By \"" .
646
- Util_Environment::w3tc_header( $config ) . "\";\n";
647
  }
648
 
649
  $rules .= $add_header_rules;
462
 
463
  if ( $w3tc )
464
  $headers_rules .= " Header set X-Powered-By \"" .
465
+ Util_Environment::w3tc_header() . "\"\n";
466
 
467
  if ( strlen( $headers_rules ) > 0 ) {
468
  $rules .= " <IfModule mod_headers.c>\n";
643
 
644
  if ( $w3tc ) {
645
  $add_header_rules .= " add_header X-Powered-By \"" .
646
+ Util_Environment::w3tc_header() . "\";\n";
647
  }
648
 
649
  $rules .= $add_header_rules;
BrowserCache_Plugin.php CHANGED
@@ -214,7 +214,7 @@ class BrowserCache_Plugin {
214
 
215
  $test_url = Util_Environment::remove_query( $url );
216
  foreach ( $exceptions as $exception ) {
217
- if ( trim( $exception ) && preg_match( '/' . $exception . '/', $test_url ) )
218
  return false;
219
  }
220
 
@@ -266,7 +266,7 @@ class BrowserCache_Plugin {
266
  * Send headers
267
  */
268
  function send_headers() {
269
- @header( 'X-Powered-By: ' . Util_Environment::w3tc_header( $this->_config ) );
270
  }
271
 
272
  /**
214
 
215
  $test_url = Util_Environment::remove_query( $url );
216
  foreach ( $exceptions as $exception ) {
217
+ if ( trim( $exception ) && preg_match( '~' . $exception . '~', $test_url ) )
218
  return false;
219
  }
220
 
266
  * Send headers
267
  */
268
  function send_headers() {
269
+ @header( 'X-Powered-By: ' . Util_Environment::w3tc_header() );
270
  }
271
 
272
  /**
CacheFlush_Locally.php CHANGED
@@ -81,7 +81,9 @@ class CacheFlush_Locally {
81
  }
82
 
83
  function minifycache_flush_all( $extras = array() ) {
84
- delete_option( 'w3tc_minify' );
 
 
85
  $this->minifycache_flush( $extras );
86
  }
87
 
81
  }
82
 
83
  function minifycache_flush_all( $extras = array() ) {
84
+ if ( $extras['minify'] == 'purge_map' )
85
+ delete_option( 'w3tc_minify' );
86
+
87
  $this->minifycache_flush( $extras );
88
  }
89
 
CdnEngine_Base.php CHANGED
@@ -392,7 +392,7 @@ class CdnEngine_Base {
392
 
393
  if ( $this->cache_config[$mime_type]['w3tc'] ) {
394
  $headers['X-Powered-By'] =
395
- Util_Environment::w3tc_header( $this->_config );
396
  }
397
 
398
 
392
 
393
  if ( $this->cache_config[$mime_type]['w3tc'] ) {
394
  $headers['X-Powered-By'] =
395
+ Util_Environment::w3tc_header();
396
  }
397
 
398
 
CdnEngine_GoogleDrive.php CHANGED
@@ -28,16 +28,18 @@ class CdnEngine_GoogleDrive extends CdnEngine_Base {
28
  $this->_root_url = rtrim( $config['root_url'], '/' ) . '/';
29
  $this->_new_access_token_callback = $config['new_access_token_callback'];
30
 
 
31
  $this->_init_service( $config['access_token'] );
 
32
  }
33
 
34
 
35
 
36
  private function _init_service( $access_token ) {
37
- $client = new \Google_Client();
38
  $client->setClientId( $this->_client_id );
39
  $client->setAccessToken( $access_token );
40
- $this->_service = new \Google_Service_Drive( $client );
41
  }
42
 
43
 
@@ -113,7 +115,7 @@ class CdnEngine_GoogleDrive extends CdnEngine_Base {
113
  if ( $listed_files[$m]->title == $title_to_search ) {
114
  try {
115
  $this->_service->files->delete( $listed_files[$m]->id );
116
- } catch ( \Google_Service_Exception $e ) {
117
  $errors = $e->getErrors();
118
  $details = '';
119
  if ( count( $errors ) >= 1 ) {
@@ -156,7 +158,7 @@ class CdnEngine_GoogleDrive extends CdnEngine_Base {
156
 
157
  $mtime = @filemtime( $local_path );
158
 
159
- $p = new \Google_Service_Drive_Property();
160
  $p->key = 'mtime';
161
  $p->value = $mtime;
162
  $properties[] = $p;
@@ -184,11 +186,11 @@ class CdnEngine_GoogleDrive extends CdnEngine_Base {
184
  $content = file_get_contents( $local_path );
185
  }
186
 
187
- $file = new \Google_Service_Drive_DriveFile();
188
  $file->setTitle( $title );
189
  $file->setProperties( $properties );
190
 
191
- $parent = new \Google_Service_Drive_ParentReference();
192
  $parent->setId( $parent_id );
193
  $file->setParents( array( $parent ) );
194
 
@@ -209,7 +211,7 @@ class CdnEngine_GoogleDrive extends CdnEngine_Base {
209
  'uploadType' => 'media'
210
  ) );
211
 
212
- $permission = new \Google_Service_Drive_Permission();
213
  $permission->setValue( '' );
214
  $permission->setType( 'anyone' );
215
  $permission->setRole( 'reader' );
@@ -217,7 +219,7 @@ class CdnEngine_GoogleDrive extends CdnEngine_Base {
217
  $this->_service->permissions->insert( $created_file->id,
218
  $permission );
219
  }
220
- } catch ( \Google_Auth_Exception $e ) {
221
  if ( $allow_refresh_token )
222
  return 'refresh_required';
223
 
@@ -227,7 +229,7 @@ class CdnEngine_GoogleDrive extends CdnEngine_Base {
227
  $results[] = $this->_get_result( $file_descriptor['local_path'],
228
  $file_descriptor['remote_path'], W3TC_CDN_RESULT_OK,
229
  'OK', $file_descriptor );
230
- } catch ( \Google_Service_Exception $e ) {
231
  $errors = $e->getErrors();
232
  $details = '';
233
  if ( count( $errors ) >= 1 ) {
@@ -332,7 +334,7 @@ class CdnEngine_GoogleDrive extends CdnEngine_Base {
332
  if ( !is_null( $timeout_time ) && time() > $timeout_time )
333
  return array( 'timeout', array() );
334
  }
335
- } catch ( \Google_Auth_Exception $e ) {
336
  if ( $allow_refresh_token )
337
  return array( 'refresh_required', array() );
338
 
@@ -352,7 +354,7 @@ class CdnEngine_GoogleDrive extends CdnEngine_Base {
352
  'and trashed = false'
353
  )
354
  );
355
- } catch ( \Google_Auth_Exception $e ) {
356
  if ( $allow_refresh_token )
357
  return array( 'refresh_required', array() );
358
 
@@ -426,18 +428,18 @@ class CdnEngine_GoogleDrive extends CdnEngine_Base {
426
  $id = $items[0]->id;
427
  } else {
428
  // create folder
429
- $file = new \Google_Service_Drive_DriveFile( array(
430
  'title' => $folder,
431
  'mimeType' => 'application/vnd.google-apps.folder' ) );
432
 
433
- $parent = new \Google_Service_Drive_ParentReference();
434
  $parent->setId( $root_id );
435
  $file->setParents( array( $parent ) );
436
 
437
  $created_file = $this->_service->files->insert( $file );
438
  $id = $created_file->id;
439
 
440
- $permission = new \Google_Service_Drive_Permission();
441
  $permission->setValue( '' );
442
  $permission->setType( 'anyone' );
443
  $permission->setRole( 'reader' );
28
  $this->_root_url = rtrim( $config['root_url'], '/' ) . '/';
29
  $this->_new_access_token_callback = $config['new_access_token_callback'];
30
 
31
+ try {
32
  $this->_init_service( $config['access_token'] );
33
+ } catch ( \Exception $e ) {}
34
  }
35
 
36
 
37
 
38
  private function _init_service( $access_token ) {
39
+ $client = new \W3TCG_Google_Client();
40
  $client->setClientId( $this->_client_id );
41
  $client->setAccessToken( $access_token );
42
+ $this->_service = new \W3TCG_Google_Service_Drive( $client );
43
  }
44
 
45
 
115
  if ( $listed_files[$m]->title == $title_to_search ) {
116
  try {
117
  $this->_service->files->delete( $listed_files[$m]->id );
118
+ } catch ( \W3TCG_Google_Service_Exception $e ) {
119
  $errors = $e->getErrors();
120
  $details = '';
121
  if ( count( $errors ) >= 1 ) {
158
 
159
  $mtime = @filemtime( $local_path );
160
 
161
+ $p = new \W3TCG_Google_Service_Drive_Property();
162
  $p->key = 'mtime';
163
  $p->value = $mtime;
164
  $properties[] = $p;
186
  $content = file_get_contents( $local_path );
187
  }
188
 
189
+ $file = new \W3TCG_Google_Service_Drive_DriveFile();
190
  $file->setTitle( $title );
191
  $file->setProperties( $properties );
192
 
193
+ $parent = new \W3TCG_Google_Service_Drive_ParentReference();
194
  $parent->setId( $parent_id );
195
  $file->setParents( array( $parent ) );
196
 
211
  'uploadType' => 'media'
212
  ) );
213
 
214
+ $permission = new \W3TCG_Google_Service_Drive_Permission();
215
  $permission->setValue( '' );
216
  $permission->setType( 'anyone' );
217
  $permission->setRole( 'reader' );
219
  $this->_service->permissions->insert( $created_file->id,
220
  $permission );
221
  }
222
+ } catch ( \W3TCG_Google_Auth_Exception $e ) {
223
  if ( $allow_refresh_token )
224
  return 'refresh_required';
225
 
229
  $results[] = $this->_get_result( $file_descriptor['local_path'],
230
  $file_descriptor['remote_path'], W3TC_CDN_RESULT_OK,
231
  'OK', $file_descriptor );
232
+ } catch ( \W3TCG_Google_Service_Exception $e ) {
233
  $errors = $e->getErrors();
234
  $details = '';
235
  if ( count( $errors ) >= 1 ) {
334
  if ( !is_null( $timeout_time ) && time() > $timeout_time )
335
  return array( 'timeout', array() );
336
  }
337
+ } catch ( \W3TCG_Google_Auth_Exception $e ) {
338
  if ( $allow_refresh_token )
339
  return array( 'refresh_required', array() );
340
 
354
  'and trashed = false'
355
  )
356
  );
357
+ } catch ( \W3TCG_Google_Auth_Exception $e ) {
358
  if ( $allow_refresh_token )
359
  return array( 'refresh_required', array() );
360
 
428
  $id = $items[0]->id;
429
  } else {
430
  // create folder
431
+ $file = new \W3TCG_Google_Service_Drive_DriveFile( array(
432
  'title' => $folder,
433
  'mimeType' => 'application/vnd.google-apps.folder' ) );
434
 
435
+ $parent = new \W3TCG_Google_Service_Drive_ParentReference();
436
  $parent->setId( $root_id );
437
  $file->setParents( array( $parent ) );
438
 
439
  $created_file = $this->_service->files->insert( $file );
440
  $id = $created_file->id;
441
 
442
+ $permission = new \W3TCG_Google_Service_Drive_Permission();
443
  $permission->setValue( '' );
444
  $permission->setType( 'anyone' );
445
  $permission->setRole( 'reader' );
Cdn_GoogleDrive_AdminActions.php CHANGED
@@ -26,17 +26,17 @@ class Cdn_GoogleDrive_AdminActions {
26
  $access_token = stripslashes( $_POST['access_token'] );
27
  $refresh_token = stripslashes( $_POST['refresh_token'] );
28
 
29
- $client = new \Google_Client();
30
  $client->setClientId( $client_id );
31
  $client->setAccessToken( $access_token );
32
 
33
  //
34
  // get folder details
35
  //
36
- $service = new \Google_Service_Drive( $client );
37
 
38
  if ( empty( $_POST['folder'] ) ) {
39
- $file = new \Google_Service_Drive_DriveFile( array(
40
  'title' => $_POST['folder_new'],
41
  'mimeType' => 'application/vnd.google-apps.folder' ) );
42
 
@@ -46,7 +46,7 @@ class Cdn_GoogleDrive_AdminActions {
46
  $used_folder_id = $_POST['folder'];
47
  }
48
 
49
- $permission = new \Google_Service_Drive_Permission();
50
  $permission->setValue( '' );
51
  $permission->setType( 'anyone' );
52
  $permission->setRole( 'reader' );
26
  $access_token = stripslashes( $_POST['access_token'] );
27
  $refresh_token = stripslashes( $_POST['refresh_token'] );
28
 
29
+ $client = new \W3TCG_Google_Client();
30
  $client->setClientId( $client_id );
31
  $client->setAccessToken( $access_token );
32
 
33
  //
34
  // get folder details
35
  //
36
+ $service = new \W3TCG_Google_Service_Drive( $client );
37
 
38
  if ( empty( $_POST['folder'] ) ) {
39
+ $file = new \W3TCG_Google_Service_Drive_DriveFile( array(
40
  'title' => $_POST['folder_new'],
41
  'mimeType' => 'application/vnd.google-apps.folder' ) );
42
 
46
  $used_folder_id = $_POST['folder'];
47
  }
48
 
49
+ $permission = new \W3TCG_Google_Service_Drive_Permission();
50
  $permission->setValue( '' );
51
  $permission->setType( 'anyone' );
52
  $permission->setRole( 'reader' );
Cdn_GoogleDrive_Popup_AuthReturn.php CHANGED
@@ -16,12 +16,12 @@ class Cdn_GoogleDrive_Popup_AuthReturn {
16
  );
17
  $access_token = json_encode( $token_array );
18
 
19
- $client = new \Google_Client();
20
  $client->setClientId( $client_id );
21
  $client->setAccessToken( $access_token );
22
 
23
 
24
- $service = new \Google_Service_Drive( $client );
25
 
26
  $items = $service->files->listFiles( array(
27
  'q' => "mimeType = 'application/vnd.google-apps.folder'"
16
  );
17
  $access_token = json_encode( $token_array );
18
 
19
+ $client = new \W3TCG_Google_Client();
20
  $client->setClientId( $client_id );
21
  $client->setAccessToken( $access_token );
22
 
23
 
24
+ $service = new \W3TCG_Google_Service_Drive( $client );
25
 
26
  $items = $service->files->listFiles( array(
27
  'q' => "mimeType = 'application/vnd.google-apps.folder'"
ConfigKeys.php CHANGED
@@ -878,7 +878,7 @@ $keys = array(
878
  ),
879
  'minify.cache.files' => array(
880
  'type' => 'array',
881
- 'default' => array( 'https://ajax.googleapis.com' )
882
  ),
883
 
884
  'cdn.configuration_overloaded' => array(
878
  ),
879
  'minify.cache.files' => array(
880
  'type' => 'array',
881
+ 'default' => array( '' )
882
  ),
883
 
884
  'cdn.configuration_overloaded' => array(
Extension_Amp_Plugin.php ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace W3TC;
3
+
4
+ class Extension_Amp_Plugin {
5
+ function __construct() {
6
+ $is_amp_endpoint = null;
7
+ }
8
+
9
+ public function run() {
10
+ add_filter( 'w3tc_minify_js_enable',
11
+ array( $this, 'w3tc_minify_jscss_enable' ) );
12
+ add_filter( 'w3tc_minify_css_enable',
13
+ array( $this, 'w3tc_minify_jscss_enable' ) );
14
+ add_filter( 'w3tc_footer_comment',
15
+ array( $this, 'w3tc_footer_comment' ) );
16
+
17
+ }
18
+
19
+
20
+
21
+ private function is_amp_endpoint() {
22
+ if ( is_null( $is_amp_endpoint ) && function_exists('is_amp_endpoint') ) {
23
+ $is_amp_endpoint = is_amp_endpoint();
24
+ }
25
+
26
+ return $is_amp_endpoint;
27
+ }
28
+
29
+
30
+
31
+ public function w3tc_minify_jscss_enable( $enabled ) {
32
+ $is_amp_endpoint = $this->is_amp_endpoint();
33
+
34
+ if ( !is_null( $is_amp_endpoint ) && $is_amp_endpoint ) {
35
+ // amp has own rules for CSS and JS files, don't touch them by default
36
+ return false;
37
+ }
38
+
39
+ return $enabled;
40
+ }
41
+
42
+
43
+
44
+ public function w3tc_footer_comment( $strings ) {
45
+ $is_amp_endpoint = $this->is_amp_endpoint();
46
+
47
+ if ( !is_null( $is_amp_endpoint ) && $is_amp_endpoint ) {
48
+ $strings[] = 'AMP page, minification is limited';
49
+ }
50
+
51
+ return $strings;
52
+ }
53
+ }
54
+
55
+
56
+
57
+ $p = new Extension_Amp_Plugin();
58
+ $p->run();
59
+
60
+ if ( is_admin() ) {
61
+ $p = new Extension_Amp_Plugin_Admin();
62
+ $p->run();
63
+ }
Extension_Amp_Plugin_Admin.php ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace W3TC;
3
+
4
+ class Extension_Amp_Plugin_Admin {
5
+ function run() {
6
+ }
7
+
8
+ static public function w3tc_extensions( $extensions, $config ) {
9
+ $enabled = true;
10
+ $disabled_message = '';
11
+
12
+ $requirements = array();
13
+
14
+ $extensions['amp'] = array(
15
+ 'name' => 'AMP',
16
+ 'author' => 'W3 EDGE',
17
+ 'description' => __( 'Adds compatibility for accelerated mobile pages (AMP) to minify.',
18
+ 'w3-total-cache' ),
19
+ 'author_uri' => 'https://www.w3-edge.com/',
20
+ 'extension_uri' => 'https://www.w3-edge.com/',
21
+ 'extension_id' => 'amp',
22
+ 'settings_exists' => false,
23
+ 'version' => '0.1',
24
+ 'enabled' => $enabled,
25
+ 'disabled_message' => $disabled_message,
26
+ 'requirements' => implode( ', ', $requirements ),
27
+ 'path' => 'w3-total-cache/Extension_Amp_Plugin.php'
28
+ );
29
+
30
+ return $extensions;
31
+ }
32
+ }
Extension_CloudFlare_Api.php CHANGED
@@ -107,9 +107,18 @@ class Extension_CloudFlare_Api {
107
 
108
 
109
 
110
- public function zones() {
111
- return $this->_wp_remote_request( 'GET',
112
- self::$_root_uri . '/zones' );
 
 
 
 
 
 
 
 
 
113
  }
114
 
115
 
@@ -196,4 +205,50 @@ class Extension_CloudFlare_Api {
196
 
197
  return array();
198
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
199
  }
107
 
108
 
109
 
110
+ public function zones($page = 1) {
111
+ return $this->_wp_remote_request_with_meta( 'GET',
112
+ self::$_root_uri . '/zones?page=' . urlencode($page) );
113
+ }
114
+
115
+
116
+
117
+ public function zone($id) {
118
+ $a = $this->_wp_remote_request( 'GET',
119
+ self::$_root_uri . '/zones/' . $id );
120
+
121
+ return $a;
122
  }
123
 
124
 
205
 
206
  return array();
207
  }
208
+
209
+
210
+
211
+ private function _wp_remote_request_with_meta( $method, $url, $body = array() ) {
212
+ $result = wp_remote_request( $url, array(
213
+ 'method' => $method,
214
+ 'headers' => array(
215
+ 'Content-Type' => 'application/json',
216
+ 'X-Auth-Key' => $this->_key,
217
+ 'X-Auth-Email' => $this->_email
218
+ ),
219
+ 'timeout' => $this->_timelimit_api_request,
220
+ 'body' => $body
221
+ ) );
222
+
223
+ if ( is_wp_error( $result ) )
224
+ throw new \Exception( 'Failed to reach API endpoint' );
225
+
226
+ $response_json = @json_decode( $result['body'], true );
227
+ if ( is_null( $response_json ) || !isset( $response_json['success'] ) ) {
228
+ throw new \Exception(
229
+ 'Failed to reach API endpoint, got unexpected response ' .
230
+ $result['body'] );
231
+ }
232
+
233
+ if ( !$response_json['success'] ) {
234
+ $errors = array();
235
+ if ( isset( $response_json['errors'] ) ) {
236
+ foreach ( $response_json['errors'] as $e ) {
237
+ if ( !empty( $e['message'] ) )
238
+ $errors[] = $e['message'];
239
+ }
240
+ }
241
+
242
+ if ( empty( $errors ) )
243
+ $errors[] = 'Request failed';
244
+
245
+ throw new \Exception( implode( ', ', $errors ) );
246
+ }
247
+
248
+ if ( isset( $response_json['result'] ) ) {
249
+ return $response_json;
250
+ }
251
+
252
+ return array();
253
+ }
254
  }
Extension_CloudFlare_Page_View.js CHANGED
@@ -29,4 +29,17 @@ jQuery(function($) {
29
  W3tc_Lightbox.load_form(url, '.w3tc_extension_cloudflare_form',
30
  w3tc_extension_cloudflare_resize);
31
  })
 
 
 
 
 
 
 
 
 
 
 
 
 
32
  });
29
  W3tc_Lightbox.load_form(url, '.w3tc_extension_cloudflare_form',
30
  w3tc_extension_cloudflare_resize);
31
  })
32
+
33
+
34
+
35
+ .on('click', '.w3tc_cloudflare_zone_page', function() {
36
+ var page = jQuery(this).attr('data-page');
37
+ jQuery('input[name="w3tc_action"]').val('extension_cloudflare_intro_done');
38
+ jQuery('input[name="page"]').val(page);
39
+
40
+ var url = ajaxurl + '?action=w3tc_ajax&_wpnonce=' + w3tc_nonce;
41
+
42
+ W3tc_Lightbox.load_form(url, '.w3tc_extension_cloudflare_form',
43
+ w3tc_extension_cloudflare_resize);
44
+ })
45
  });
Extension_CloudFlare_Page_View.php CHANGED
@@ -77,7 +77,7 @@ _e( 'Specify account credentials:',
77
  <?php if ( $state == 'not_configured' ): ?>
78
  <table class="form-table">
79
  <tr><td colspan="2">
80
- CloudFlare credentials not specified yet
81
  </td></tr>
82
  </table>
83
  <?php endif ?>
@@ -111,25 +111,25 @@ CloudFlare not available: <?php echo $error_message; ?>
111
  )
112
  );
113
 
114
- Util_Ui::config_item( array(
115
- 'key' => array( 'cloudflare', 'widget_cache_mins' ),
116
- 'label' => __( 'Cache time:', 'w3-total-cache' ),
117
- 'control' => 'textbox',
118
- 'description' =>
119
- 'How many minutes data retrieved from CloudFlare ' .
120
- 'should be stored. Minimum is 1 minute.'
121
- )
122
- );
123
-
124
- Util_Ui::config_item( array(
125
- 'key' => array( 'cloudflare', 'pagecache' ),
126
- 'label' => __( 'Page Caching:', 'w3-total-cache' ),
127
- 'control' => 'checkbox',
128
- 'checkbox_label' => 'Flush CloudFlare on Post Modifications',
129
- 'description' =>
130
- 'Enable when you have html pages cached on CloudFlare level.'
131
- )
132
- );
133
 
134
  ?>
135
  </table>
@@ -163,12 +163,12 @@ self::cloudflare_selectbox( $settings, array(
163
  ) );
164
  self::cloudflare_checkbox( $settings, array(
165
  'key' => 'sort_query_string_for_cache',
166
- 'label' => 'Query String Sorting',
167
  'description' => 'CloudFlare will treat files with the same query strings as the same file in cache, regardless of the order of the query strings.',
168
  ) );
169
  self::cloudflare_selectbox( $settings, array(
170
  'key' => 'browser_cache_ttl',
171
- 'label' => 'Browser Cache TTL',
172
  'values' => array(
173
  '' => '',
174
  '30' => '30',
@@ -198,11 +198,11 @@ self::cloudflare_selectbox( $settings, array(
198
  '16070400' => '16070400',
199
  '31536000' => '31536000'
200
  ),
201
- 'description' => 'Browser Cache TTL (in seconds) specifies how long CloudFlare-cached resources will remain on your visitors\' computers.',
202
  ) );
203
  self::cloudflare_selectbox( $settings, array(
204
  'key' => 'challenge_ttl',
205
- 'label' => ' Challenge TTL',
206
  'values' => array(
207
  '' => '',
208
  '300' => '300',
@@ -220,11 +220,11 @@ self::cloudflare_selectbox( $settings, array(
220
  '2592000' => '2592000',
221
  '31536000' => '31536000'
222
  ),
223
- 'description' => 'Specify how long a visitor is allowed access to your site after successfully completing a challenge (such as a CAPTCHA). After the TTL has expired the visitor will have to complete a new challenge.',
224
  ) );
225
  self::cloudflare_selectbox( $settings, array(
226
  'key' => 'edge_cache_ttl',
227
- 'label' => 'Edge Cache TTL',
228
  'values' => array(
229
  '' => '',
230
  '300' => '300',
@@ -265,47 +265,47 @@ self::cloudflare_selectbox( $settings, array(
265
  ) );
266
  self::cloudflare_checkbox( $settings, array(
267
  'key' => 'minify_js',
268
- 'label' => 'Minify JS',
269
  'description' => 'Minify JavaScript files.',
270
  ) );
271
  self::cloudflare_checkbox( $settings, array(
272
  'key' => 'minify_css',
273
- 'label' => 'Minify CSS',
274
  'description' => 'Minify CSS files.',
275
  ) );
276
  self::cloudflare_checkbox( $settings, array(
277
  'key' => 'minify_html',
278
- 'label' => 'Minify HTML',
279
- 'description' => 'Minify HTML content.',
280
  ) );
281
  self::cloudflare_checkbox( $settings, array(
282
  'key' => 'server_side_exclude',
283
- 'label' => 'Server Side Exclude',
284
  'description' => 'If there is sensitive content on your website that you want visible to real visitors, but that you want to hide from suspicious visitors, all you have to do is wrap the content with CloudFlare SSE tags.',
285
  ) );
286
  self::cloudflare_checkbox( $settings, array(
287
  'key' => 'email_obfuscation',
288
- 'label' => 'Email obfuscation',
289
  'description' => 'Encrypt email adresses on your web page from bots, while keeping them visible to humans. ',
290
  ) );
291
  self::cloudflare_checkbox( $settings, array(
292
  'key' => 'response_buffering',
293
- 'label' => 'Response Buffering',
294
  'description' => 'CloudFlare may buffer the whole payload to deliver it at once to the client versus allowing it to be delivered in chunks.',
295
  ) );
296
  self::cloudflare_checkbox( $settings, array(
297
  'key' => 'prefetch_preload',
298
- 'label' => 'Prefetch Preload',
299
  'description' => 'CloudFlare will prefetch any URLs that are included in the response headers.',
300
  ) );
301
  self::cloudflare_checkbox( $settings, array(
302
  'key' => 'mobile_redirect',
303
- 'label' => 'Mobile Redirect',
304
  'description' => 'Automatically redirect visitors on mobile devices to a mobile-optimized subdomain',
305
  ) );
306
  self::cloudflare_checkbox( $settings, array(
307
  'key' => 'origin_error_page_pass_thru',
308
- 'label' => 'Enable Error Pages',
309
  'description' => 'CloudFlare will proxy customer error pages on any 502,504 errors on origin server instead of showing a default CloudFlare error page. This does not apply to 522 errors and is limited to Enterprise Zones.',
310
  ) );
311
 
@@ -319,12 +319,12 @@ echo '<table class="form-table">';
319
 
320
  self::cloudflare_checkbox( $settings, array(
321
  'key' => 'hotlink_protection',
322
- 'label' => 'Hotlink Protection',
323
  'description' => 'When enabled, the Hotlink Protection option ensures that other sites cannot suck up your bandwidth by building pages that use images hosted on your site.',
324
  ) );
325
  self::cloudflare_checkbox( $settings, array(
326
  'key' => 'mirage',
327
- 'label' => 'Mirage',
328
  'description' => 'Automatically optimize image loading for website visitors on mobile devices',
329
  ) );
330
  self::cloudflare_selectbox( $settings, array(
@@ -349,7 +349,7 @@ echo '<table class="form-table">';
349
 
350
  self::cloudflare_selectbox( $settings, array(
351
  'key' => 'security_level',
352
- 'label' => __( 'Security Level:', 'w3-total-cache' ),
353
  'values' => array(
354
  '' => '',
355
  'essentially_off' => 'Off',
@@ -362,27 +362,27 @@ self::cloudflare_selectbox( $settings, array(
362
  ) );
363
  self::cloudflare_checkbox( $settings, array(
364
  'key' => 'browser_check',
365
- 'label' => 'Browser Integrity Check',
366
  'description' => 'Browser Integrity Check is similar to Bad Behavior and looks for common HTTP headers abused most commonly by spammers and denies access to your page. It will also challenge visitors that do not have a user agent or a non standard user agent (also commonly used by abuse bots, crawlers or visitors).',
367
  ) );
368
  self::cloudflare_checkbox( $settings, array(
369
  'key' => 'always_online',
370
- 'label' => 'Always Online',
371
  'description' => 'When enabled, Always Online will serve pages from our cache if your server is offline',
372
  ) );
373
  self::cloudflare_checkbox( $settings, array(
374
  'key' => 'waf',
375
- 'label' => 'Web Application Firewall',
376
- 'description' => 'The WAF examines HTTP requests to your website. It inspects both GET and POST requests and applies rules to help filter out illegitimate traffic from legitimate website visitors.'
377
  ) );
378
  self::cloudflare_checkbox( $settings, array(
379
  'key' => 'advanced_ddos',
380
- 'label' => 'Advanced DDOS Protection',
381
  'description' => 'Advanced protection from Distributed Denial of Service (DDoS) attacks on your website.',
382
  ) );
383
  self::cloudflare_textbox( $settings, array(
384
  'key' => 'max_upload',
385
- 'label' => 'Max Upload',
386
  'description' => 'Max size of file allowed for uploading',
387
  ) );
388
 
@@ -390,28 +390,23 @@ self::cloudflare_textbox( $settings, array(
390
  echo '</table>';
391
  self::cloudflare_button_save( 'protection' );
392
  Util_Ui::postbox_footer();
393
- Util_Ui::postbox_header( __( 'CloudFlare: IP', 'w3-total-cache' ), '', 'general' );
394
  echo '<table class="form-table">';
395
 
396
 
397
  self::cloudflare_checkbox( $settings, array(
398
  'key' => 'ip_geolocation',
399
- 'label' => 'IP Geolocation',
400
- 'description' => 'Enable IP Geolocation to have CloudFlare geolocate visitors to your website and pass the country code to you.',
401
  ) );
402
  self::cloudflare_checkbox( $settings, array(
403
  'key' => 'ipv6',
404
- 'label' => 'IPv6',
405
  'description' => 'Enable IPv6.',
406
  ) );
407
- self::cloudflare_checkbox( $settings, array(
408
- 'key' => 'pseudo_ipv4',
409
- 'label' => 'Pseudo IPv4',
410
- 'description' => 'Support for IPv6 addresses in legacy IPv4 applications.',
411
- ) );
412
  self::cloudflare_checkbox( $settings, array(
413
  'key' => 'true_client_ip_header',
414
- 'label' => 'True Client IP',
415
  'description' => 'Allows customer to continue to use True Client IP (Akamai feature) in the headers we send to the origin.',
416
  ) );
417
 
@@ -419,36 +414,36 @@ self::cloudflare_checkbox( $settings, array(
419
  echo '</table>';
420
  self::cloudflare_button_save( 'ip' );
421
  Util_Ui::postbox_footer();
422
- Util_Ui::postbox_header( __( 'CloudFlare: SSL', 'w3-total-cache' ), '', 'general' );
423
  echo '<table class="form-table">';
424
 
425
 
426
  self::cloudflare_selectbox( $settings, array(
427
  'key' => 'ssl',
428
- 'label' => 'SSL',
429
  'values' => array(
430
  '' => '',
431
  'off' => 'Off',
432
- 'flexible' => 'Flexible (https to end-user only)',
433
  'full' => 'Full (https everywhere)',
434
  'full_strict' => 'Strict'
435
  ),
436
- 'description' => 'SSL encrypts your visitor\'s connection and safeguards credit card numbers and other personal data to and from your website.',
437
  ) );
438
  self::cloudflare_checkbox( $settings, array(
439
  'key' => 'security_header',
440
- 'label' => 'Security Header (HSTS)',
441
- 'description' => 'Enables or disables HSTS header.',
442
  ) );
443
  self::cloudflare_checkbox( $settings, array(
444
  'key' => 'tls_1_2_only',
445
- 'label' => 'TLS 1.2 Only',
446
- 'description' => 'Enable Crypto TLS 1.2 feature for this zone and prevent use of previous versions.',
447
  ) );
448
  self::cloudflare_checkbox( $settings, array(
449
  'key' => 'tls_client_auth',
450
- 'label' => 'TLS Client Auth',
451
- 'description' => 'TLS Client Auth requires CloudFlare to connect to your origin server using a client certificate',
452
  ) );
453
 
454
  echo '</table>';
77
  <?php if ( $state == 'not_configured' ): ?>
78
  <table class="form-table">
79
  <tr><td colspan="2">
80
+ Authenticate your account in order to access settings.
81
  </td></tr>
82
  </table>
83
  <?php endif ?>
111
  )
112
  );
113
 
114
+ Util_Ui::config_item( array(
115
+ 'key' => array( 'cloudflare', 'widget_cache_mins' ),
116
+ 'label' => __( 'Cache time:', 'w3-total-cache' ),
117
+ 'control' => 'textbox',
118
+ 'description' =>
119
+ 'How many minutes data retrieved from CloudFlare:' .
120
+ 'should be stored. Minimum is 1 minute.'
121
+ )
122
+ );
123
+
124
+ Util_Ui::config_item( array(
125
+ 'key' => array( 'cloudflare', 'pagecache' ),
126
+ 'label' => __( 'Page caching:', 'w3-total-cache' ),
127
+ 'control' => 'checkbox',
128
+ 'checkbox_label' => 'Flush CloudFlare on Post Modifications:',
129
+ 'description' =>
130
+ 'Enable when you have html pages cached on CloudFlare level.'
131
+ )
132
+ );
133
 
134
  ?>
135
  </table>
163
  ) );
164
  self::cloudflare_checkbox( $settings, array(
165
  'key' => 'sort_query_string_for_cache',
166
+ 'label' => 'Query string sorting:',
167
  'description' => 'CloudFlare will treat files with the same query strings as the same file in cache, regardless of the order of the query strings.',
168
  ) );
169
  self::cloudflare_selectbox( $settings, array(
170
  'key' => 'browser_cache_ttl',
171
+ 'label' => 'Browser cache <acronym title="Time-to-Live ">TTL</acronym>:',
172
  'values' => array(
173
  '' => '',
174
  '30' => '30',
198
  '16070400' => '16070400',
199
  '31536000' => '31536000'
200
  ),
201
+ 'description' => 'Browser cache <acronym title="Time-to-Live ">TTL</acronym> (in seconds) specifies how long CloudFlare-cached resources will remain on your visitors\' computers.',
202
  ) );
203
  self::cloudflare_selectbox( $settings, array(
204
  'key' => 'challenge_ttl',
205
+ 'label' => 'Challenge <acronym title="Time-to-Live ">TTL</acronym>:',
206
  'values' => array(
207
  '' => '',
208
  '300' => '300',
220
  '2592000' => '2592000',
221
  '31536000' => '31536000'
222
  ),
223
+ 'description' => 'Specify how long a visitor is allowed access to your site after successfully completing a challenge (such as a CAPTCHA). After the <acronym title="Time-to-Live ">TTL</acronym> has expired the visitor will have to complete a new challenge.',
224
  ) );
225
  self::cloudflare_selectbox( $settings, array(
226
  'key' => 'edge_cache_ttl',
227
+ 'label' => 'Edge cache TTL:',
228
  'values' => array(
229
  '' => '',
230
  '300' => '300',
265
  ) );
266
  self::cloudflare_checkbox( $settings, array(
267
  'key' => 'minify_js',
268
+ 'label' => 'Minify <acronym title="JavaScript">JS</acronym>:',
269
  'description' => 'Minify JavaScript files.',
270
  ) );
271
  self::cloudflare_checkbox( $settings, array(
272
  'key' => 'minify_css',
273
+ 'label' => 'Minify <acronym title="Cascading Style Sheet">CSS</acronym>:',
274
  'description' => 'Minify CSS files.',
275
  ) );
276
  self::cloudflare_checkbox( $settings, array(
277
  'key' => 'minify_html',
278
+ 'label' => 'Minify <acronym title="HyperText Markup Language">HTML</acronym>:',
279
+ 'description' => 'Minify <acronym title="HyperText Markup Language">HTML</acronym> content.',
280
  ) );
281
  self::cloudflare_checkbox( $settings, array(
282
  'key' => 'server_side_exclude',
283
+ 'label' => 'Server side exclude:',
284
  'description' => 'If there is sensitive content on your website that you want visible to real visitors, but that you want to hide from suspicious visitors, all you have to do is wrap the content with CloudFlare SSE tags.',
285
  ) );
286
  self::cloudflare_checkbox( $settings, array(
287
  'key' => 'email_obfuscation',
288
+ 'label' => 'Email obfuscation:',
289
  'description' => 'Encrypt email adresses on your web page from bots, while keeping them visible to humans. ',
290
  ) );
291
  self::cloudflare_checkbox( $settings, array(
292
  'key' => 'response_buffering',
293
+ 'label' => 'Response buffering"',
294
  'description' => 'CloudFlare may buffer the whole payload to deliver it at once to the client versus allowing it to be delivered in chunks.',
295
  ) );
296
  self::cloudflare_checkbox( $settings, array(
297
  'key' => 'prefetch_preload',
298
+ 'label' => 'Prefetch preload:',
299
  'description' => 'CloudFlare will prefetch any URLs that are included in the response headers.',
300
  ) );
301
  self::cloudflare_checkbox( $settings, array(
302
  'key' => 'mobile_redirect',
303
+ 'label' => 'Mobile redirect:',
304
  'description' => 'Automatically redirect visitors on mobile devices to a mobile-optimized subdomain',
305
  ) );
306
  self::cloudflare_checkbox( $settings, array(
307
  'key' => 'origin_error_page_pass_thru',
308
+ 'label' => 'Enable error pages:',
309
  'description' => 'CloudFlare will proxy customer error pages on any 502,504 errors on origin server instead of showing a default CloudFlare error page. This does not apply to 522 errors and is limited to Enterprise Zones.',
310
  ) );
311
 
319
 
320
  self::cloudflare_checkbox( $settings, array(
321
  'key' => 'hotlink_protection',
322
+ 'label' => 'Hotlink protection:',
323
  'description' => 'When enabled, the Hotlink Protection option ensures that other sites cannot suck up your bandwidth by building pages that use images hosted on your site.',
324
  ) );
325
  self::cloudflare_checkbox( $settings, array(
326
  'key' => 'mirage',
327
+ 'label' => 'Mirage:',
328
  'description' => 'Automatically optimize image loading for website visitors on mobile devices',
329
  ) );
330
  self::cloudflare_selectbox( $settings, array(
349
 
350
  self::cloudflare_selectbox( $settings, array(
351
  'key' => 'security_level',
352
+ 'label' => __( 'Security level:', 'w3-total-cache' ),
353
  'values' => array(
354
  '' => '',
355
  'essentially_off' => 'Off',
362
  ) );
363
  self::cloudflare_checkbox( $settings, array(
364
  'key' => 'browser_check',
365
+ 'label' => 'Browser integrity check:',
366
  'description' => 'Browser Integrity Check is similar to Bad Behavior and looks for common HTTP headers abused most commonly by spammers and denies access to your page. It will also challenge visitors that do not have a user agent or a non standard user agent (also commonly used by abuse bots, crawlers or visitors).',
367
  ) );
368
  self::cloudflare_checkbox( $settings, array(
369
  'key' => 'always_online',
370
+ 'label' => 'Always online:',
371
  'description' => 'When enabled, Always Online will serve pages from our cache if your server is offline',
372
  ) );
373
  self::cloudflare_checkbox( $settings, array(
374
  'key' => 'waf',
375
+ 'label' => 'Web application firewall:',
376
+ 'description' => 'The Web Application Firewall (WAF) examines HTTP requests to your website. It inspects both GET and POST requests and applies rules to help filter out illegitimate traffic from legitimate website visitors.'
377
  ) );
378
  self::cloudflare_checkbox( $settings, array(
379
  'key' => 'advanced_ddos',
380
+ 'label' => 'Advanced <acronym title="Distributed Denial of Service">DDoS</acronym> protection:',
381
  'description' => 'Advanced protection from Distributed Denial of Service (DDoS) attacks on your website.',
382
  ) );
383
  self::cloudflare_textbox( $settings, array(
384
  'key' => 'max_upload',
385
+ 'label' => 'Max upload:',
386
  'description' => 'Max size of file allowed for uploading',
387
  ) );
388
 
390
  echo '</table>';
391
  self::cloudflare_button_save( 'protection' );
392
  Util_Ui::postbox_footer();
393
+ Util_Ui::postbox_header( __( 'CloudFlare: <acronym title="Internet Protocol">IP</acronym>', 'w3-total-cache' ), '', 'general' );
394
  echo '<table class="form-table">';
395
 
396
 
397
  self::cloudflare_checkbox( $settings, array(
398
  'key' => 'ip_geolocation',
399
+ 'label' => '<acronym title="Internet Protocol">IP</acronym> geolocation:',
400
+ 'description' => 'Enable <acronym title="Internet Protocol">IP</acronym> Geolocation to have CloudFlare geolocate visitors to your website and pass the country code to you.',
401
  ) );
402
  self::cloudflare_checkbox( $settings, array(
403
  'key' => 'ipv6',
404
+ 'label' => 'IPv6:',
405
  'description' => 'Enable IPv6.',
406
  ) );
 
 
 
 
 
407
  self::cloudflare_checkbox( $settings, array(
408
  'key' => 'true_client_ip_header',
409
+ 'label' => 'True client IP:',
410
  'description' => 'Allows customer to continue to use True Client IP (Akamai feature) in the headers we send to the origin.',
411
  ) );
412
 
414
  echo '</table>';
415
  self::cloudflare_button_save( 'ip' );
416
  Util_Ui::postbox_footer();
417
+ Util_Ui::postbox_header( __( 'CloudFlare: <acronym title="Secure Sockets Layer">SSL</acronym>', 'w3-total-cache' ), '', 'general' );
418
  echo '<table class="form-table">';
419
 
420
 
421
  self::cloudflare_selectbox( $settings, array(
422
  'key' => 'ssl',
423
+ 'label' => '<acronym title="Secure Sockets Layer">SSL</acronym>:',
424
  'values' => array(
425
  '' => '',
426
  'off' => 'Off',
427
+ 'flexible' => 'Flexible (HTTPS to end-user only)',
428
  'full' => 'Full (https everywhere)',
429
  'full_strict' => 'Strict'
430
  ),
431
+ 'description' => '<acronym title="Secure Sockets Layer">SSL</acronym> encrypts your visitor\'s connection and safeguards credit card numbers and other personal data to and from your website.',
432
  ) );
433
  self::cloudflare_checkbox( $settings, array(
434
  'key' => 'security_header',
435
+ 'label' => 'Security header (<acronym title="Secure Sockets Layer">SSL</acronym>):',
436
+ 'description' => 'Enables or disables <acronym title="Secure Sockets Layer">SSL</acronym> header.',
437
  ) );
438
  self::cloudflare_checkbox( $settings, array(
439
  'key' => 'tls_1_2_only',
440
+ 'label' => '<acronym title="Transport Layer Security">TLS</acronym> 1.2 only:',
441
+ 'description' => 'Enable Crypto <acronym title="Transport Layer Security">TLS</acronym> 1.2 feature for this zone and prevent use of previous versions.',
442
  ) );
443
  self::cloudflare_checkbox( $settings, array(
444
  'key' => 'tls_client_auth',
445
+ 'label' => '<acronym title="Transport Layer Security">TLS</acronym> client auth:',
446
+ 'description' => '<acronym title="Transport Layer Security">TLS</acronym> Client authentication requires CloudFlare to connect to your origin server using a client certificate',
447
  ) );
448
 
449
  echo '</table>';
Extension_CloudFlare_Plugin.php CHANGED
@@ -134,7 +134,11 @@ class Extension_CloudFlare_Plugin {
134
  array( 'cloudflare', 'timelimit.api_request' ) )
135
  )
136
  );
137
- $api->external_event( 'WP_SPAM', json_encode( $value ) );
 
 
 
 
138
  }
139
  }
140
 
134
  array( 'cloudflare', 'timelimit.api_request' ) )
135
  )
136
  );
137
+
138
+ try {
139
+ $api->external_event( 'WP_SPAM', json_encode( $value ) );
140
+ } catch ( \Exception $ex ) {
141
+ }
142
  }
143
  }
144
 
Extension_CloudFlare_Plugin_Admin.php CHANGED
@@ -32,6 +32,7 @@ class Extension_CloudFlare_Plugin_Admin {
32
  'author_uri' => 'https://www.w3-edge.com/',
33
  'extension_uri' => 'https://www.w3-edge.com/',
34
  'extension_id' => 'cloudflare',
 
35
  'version' => '0.3',
36
  'enabled' => true,
37
  'requirements' => implode( ', ', $message ),
32
  'author_uri' => 'https://www.w3-edge.com/',
33
  'extension_uri' => 'https://www.w3-edge.com/',
34
  'extension_id' => 'cloudflare',
35
+ 'settings_exists' => true,
36
  'version' => '0.3',
37
  'enabled' => true,
38
  'requirements' => implode( ', ', $message ),
Extension_CloudFlare_Popup.php CHANGED
@@ -34,7 +34,10 @@ class Extension_CloudFlare_Popup {
34
  public function w3tc_ajax_extension_cloudflare_intro_done() {
35
  $this->_render_extension_cloudflare_zones( array(
36
  'email' => $_REQUEST['email'],
37
- 'key' => $_REQUEST['key'] ) );
 
 
 
38
  }
39
 
40
 
@@ -42,17 +45,24 @@ class Extension_CloudFlare_Popup {
42
  private function _render_extension_cloudflare_zones( $details ) {
43
  $email = $details['email'];
44
  $key = $details['key'];
 
45
 
46
  $details = array(
47
  'email' => $email,
48
- 'key' => $key
 
 
 
49
  );
50
 
51
  try {
52
  $api = new Extension_CloudFlare_Api( array(
53
  'email' => $email,
54
  'key' => $key ) );
55
- $zones = $api->zones();
 
 
 
56
  } catch ( \Exception $ex ) {
57
  $details['error_message'] = 'Can\'t authenticate: ' .
58
  $ex->getMessage();
@@ -60,8 +70,6 @@ class Extension_CloudFlare_Popup {
60
  exit();
61
  }
62
 
63
- $details['zones'] = $zones;
64
-
65
  include W3TC_DIR . '/Extension_CloudFlare_Popup_View_Zones.php';
66
  exit();
67
  }
@@ -83,15 +91,13 @@ class Extension_CloudFlare_Popup {
83
 
84
  $zone_name = '';
85
 
 
86
  try {
87
  $api = new Extension_CloudFlare_Api( array(
88
  'email' => $email,
89
  'key' => $key ) );
90
- $zones = $api->zones();
91
- foreach ( $zones as $z ) {
92
- if ( $z['id'] == $zone_id )
93
- $zone_name = $z['name'];
94
- }
95
  } catch ( \Exception $ex ) {
96
  $details['error_message'] = 'Can\'t authenticate: ' .
97
  $ex->getMessage();
34
  public function w3tc_ajax_extension_cloudflare_intro_done() {
35
  $this->_render_extension_cloudflare_zones( array(
36
  'email' => $_REQUEST['email'],
37
+ 'key' => $_REQUEST['key'],
38
+ 'page' => empty( $_REQUEST['page'] ) ? 1 : (int) $_REQUEST['page']
39
+ )
40
+ );
41
  }
42
 
43
 
45
  private function _render_extension_cloudflare_zones( $details ) {
46
  $email = $details['email'];
47
  $key = $details['key'];
48
+ $page = $details['page'];
49
 
50
  $details = array(
51
  'email' => $email,
52
+ 'key' => $key,
53
+ 'page' => $page,
54
+ 'zones' => array(),
55
+ 'total_pages' => 1
56
  );
57
 
58
  try {
59
  $api = new Extension_CloudFlare_Api( array(
60
  'email' => $email,
61
  'key' => $key ) );
62
+ $r = $api->zones( $page );
63
+ $details['zones'] = $r['result'];
64
+
65
+ $details['total_pages'] = $r['result_info']['total_pages'];
66
  } catch ( \Exception $ex ) {
67
  $details['error_message'] = 'Can\'t authenticate: ' .
68
  $ex->getMessage();
70
  exit();
71
  }
72
 
 
 
73
  include W3TC_DIR . '/Extension_CloudFlare_Popup_View_Zones.php';
74
  exit();
75
  }
91
 
92
  $zone_name = '';
93
 
94
+ // get zone name
95
  try {
96
  $api = new Extension_CloudFlare_Api( array(
97
  'email' => $email,
98
  'key' => $key ) );
99
+ $zone = $api->zone($zone_id);
100
+ $zone_name = $zone['name'];
 
 
 
101
  } catch ( \Exception $ex ) {
102
  $details['error_message'] = 'Can\'t authenticate: ' .
103
  $ex->getMessage();
Extension_CloudFlare_Popup_View_Zones.php CHANGED
@@ -10,18 +10,20 @@ if ( !defined( 'W3TC' ) )
10
  Util_Ui::hidden( '', 'w3tc_action', 'extension_cloudflare_zones_done' );
11
  Util_Ui::hidden( '', 'email', $details['email'] );
12
  Util_Ui::hidden( '', 'key', $details['key'] );
 
13
  echo Util_Ui::nonce_field( 'w3tc' );
14
 
15
  ?>
16
  <?php
17
  if ( isset( $details['error_message'] ) )
18
  echo '<div class="error">' . $details['error_message'] . '</div>';
 
19
  ?>
20
  <div class="metabox-holder">
21
  <?php Util_Ui::postbox_header( __( 'Select zone', 'w3-total-cache' ) ); ?>
22
  <table class="form-table">
23
  <tr>
24
- <th>Zone:</td>
25
  <td>
26
  <?php foreach ( $details['zones'] as $z ): ?>
27
  <label>
@@ -31,6 +33,20 @@ if ( isset( $details['error_message'] ) )
31
  </label><br />
32
  <?php endforeach ?>
33
  </tr>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
34
  </table>
35
 
36
  <p class="submit">
10
  Util_Ui::hidden( '', 'w3tc_action', 'extension_cloudflare_zones_done' );
11
  Util_Ui::hidden( '', 'email', $details['email'] );
12
  Util_Ui::hidden( '', 'key', $details['key'] );
13
+ Util_Ui::hidden( '', 'page', '' );
14
  echo Util_Ui::nonce_field( 'w3tc' );
15
 
16
  ?>
17
  <?php
18
  if ( isset( $details['error_message'] ) )
19
  echo '<div class="error">' . $details['error_message'] . '</div>';
20
+
21
  ?>
22
  <div class="metabox-holder">
23
  <?php Util_Ui::postbox_header( __( 'Select zone', 'w3-total-cache' ) ); ?>
24
  <table class="form-table">
25
  <tr>
26
+ <td>Zone:</td>
27
  <td>
28
  <?php foreach ( $details['zones'] as $z ): ?>
29
  <label>
33
  </label><br />
34
  <?php endforeach ?>
35
  </tr>
36
+ <tr>
37
+ <td></td>
38
+ <td>
39
+ <?php
40
+ if ( $details['total_pages'] > 1 ):
41
+ for ( $page = 1; $page <= $details['total_pages']; $page++ ):
42
+ if ( $page == $details['page']):
43
+ echo $page;
44
+ else: ?>
45
+ <a href="#" class="w3tc_cloudflare_zone_page" data-page="<?php echo $page ?>"><?php echo $page ?></a>
46
+ <?php endif ?>
47
+ &nbsp;
48
+ <?php endfor ?>
49
+ <?php endif ?>
50
  </table>
51
 
52
  <p class="submit">
Extension_CloudFlare_Widget.php CHANGED
@@ -20,7 +20,8 @@ class Extension_CloudFlare_Widget {
20
 
21
 
22
  function w3tc_widget_setup() {
23
- Util_Widget::add( 'w3tc_cloudflare', __( 'CloudFlare', 'w3-total-cache' ),
 
24
  array( $this, 'widget_form' ),
25
  Util_Ui::admin_url( 'admin.php?page=w3tc_general#cloudflare' ),
26
  'normal' );
20
 
21
 
22
  function w3tc_widget_setup() {
23
+ Util_Widget::add( 'w3tc_cloudflare',
24
+ '<div class="w3tc_cloudflare_widget_logo"></div>',
25
  array( $this, 'widget_form' ),
26
  Util_Ui::admin_url( 'admin.php?page=w3tc_general#cloudflare' ),
27
  'normal' );
Extension_CloudFlare_Widget_Logo.png ADDED
Binary file
Extension_CloudFlare_Widget_View.css CHANGED
@@ -29,4 +29,12 @@ td.cloudflare_td_value {
29
  padding-right: 8px;
30
  text-align: right;
31
  color: #333;
 
 
 
 
 
 
 
 
32
  }
29
  padding-right: 8px;
30
  text-align: right;
31
  color: #333;
32
+ }
33
+
34
+ .w3tc_cloudflare_widget_logo {
35
+ float: left;
36
+ width: 220px;
37
+ height: 35px;
38
+ background: url("Extension_CloudFlare_Widget_Logo.png") no-repeat;
39
+ background-size: contain;
40
  }
Extension_FeedBurner_Page_View.php CHANGED
@@ -26,8 +26,8 @@ else
26
  Util_Ui::config_item( array(
27
  'key' => array( 'feedburner', 'urls' ),
28
  'control' => 'textarea',
29
- 'label' => __( 'Additional URLs:', 'w3-total-cache' ),
30
- 'description' => __( 'Specify any additional feed URLs to ping on FeedBurner.',
31
  'w3-total-cache' )
32
  ) )
33
  ?>
26
  Util_Ui::config_item( array(
27
  'key' => array( 'feedburner', 'urls' ),
28
  'control' => 'textarea',
29
+ 'label' => __( 'Additional <acronym title="Uniform Resource Locator">URL</acronym>s:', 'w3-total-cache' ),
30
+ 'description' => __( 'Specify any additional feed <acronym title="Uniform Resource Locator">URL</acronym>s to ping on FeedBurner.',
31
  'w3-total-cache' )
32
  ) )
33
  ?>
Extension_FeedBurner_Plugin_Admin.php CHANGED
@@ -44,6 +44,7 @@ class Extension_FeedBurner_Plugin_Admin {
44
  'author_uri' => 'https://www.w3-edge.com/',
45
  'extension_uri' => 'https://www.w3-edge.com/',
46
  'extension_id' => 'feedburner',
 
47
  'version' => '0.1',
48
  'enabled' => true,
49
  'requirements' => implode( ', ', $message ),
44
  'author_uri' => 'https://www.w3-edge.com/',
45
  'extension_uri' => 'https://www.w3-edge.com/',
46
  'extension_id' => 'feedburner',
47
+ 'settings_exists' => true,
48
  'version' => '0.1',
49
  'enabled' => true,
50
  'requirements' => implode( ', ', $message ),
Extension_FragmentCache_Api.php CHANGED
@@ -71,8 +71,7 @@ function w3tc_fragmentcache_start( $id, $group = '', $hook = '' ) {
71
  } else {
72
  echo $fragment;
73
  if ( $hook ) {
74
- global $wp_filter;
75
- $wp_filter[$hook] = array();
76
  }
77
  return true;
78
  }
@@ -93,8 +92,7 @@ function w3tc_fragmentcache_filter_start( $id, $group = '', $hook = '', $data )
93
  $fragment = w3tc_fragmentcache_get( $id, $group );
94
  if ( false !== $fragment ) {
95
  if ( $hook ) {
96
- global $wp_filter;
97
- $wp_filter[$hook] = array();
98
  }
99
  return $fragment;
100
  }
71
  } else {
72
  echo $fragment;
73
  if ( $hook ) {
74
+ remove_all_filters($hook);
 
75
  }
76
  return true;
77
  }
92
  $fragment = w3tc_fragmentcache_get( $id, $group );
93
  if ( false !== $fragment ) {
94
  if ( $hook ) {
95
+ remove_all_filters($hook);
 
96
  }
97
  return $fragment;
98
  }
Extension_FragmentCache_Plugin_Admin.php CHANGED
@@ -22,6 +22,7 @@ class Extension_FragmentCache_Plugin_Admin {
22
  'author_uri' => 'https://www.w3-edge.com/',
23
  'extension_uri' => 'https://www.w3-edge.com/',
24
  'extension_id' => 'fragmentcache',
 
25
  'version' => '1.0',
26
  'enabled' => empty( $requirements ),
27
  'requirements' => implode( ', ', $requirements ),
22
  'author_uri' => 'https://www.w3-edge.com/',
23
  'extension_uri' => 'https://www.w3-edge.com/',
24
  'extension_id' => 'fragmentcache',
25
+ 'settings_exists' => true,
26
  'version' => '1.0',
27
  'enabled' => empty( $requirements ),
28
  'requirements' => implode( ', ', $requirements ),
Extension_FragmentCache_WpObjectCache.php CHANGED
@@ -163,7 +163,7 @@ class Extension_FragmentCache_WpObjectCache {
163
  }
164
 
165
  if ( is_object( $value ) ) {
166
- $value = clone( $value );
167
  }
168
 
169
  $this->cache[$fragment_group][$key] = $value;
@@ -214,7 +214,7 @@ class Extension_FragmentCache_WpObjectCache {
214
  $key = $this->_get_cache_key( $id );
215
 
216
  if ( is_object( $data ) ) {
217
- $data = clone( $data );
218
  }
219
 
220
  list( $fragment_group, $fragment_group_expiration, $fragment_group_global ) =
163
  }
164
 
165
  if ( is_object( $value ) ) {
166
+ $value = clone $value;
167
  }
168
 
169
  $this->cache[$fragment_group][$key] = $value;
214
  $key = $this->_get_cache_key( $id );
215
 
216
  if ( is_object( $data ) ) {
217
+ $data = clone $data;
218
  }
219
 
220
  list( $fragment_group, $fragment_group_expiration, $fragment_group_global ) =
Extension_Genesis_Plugin_Admin.php CHANGED
@@ -42,6 +42,7 @@ class Extension_Genesis_Plugin_Admin {
42
  'author_uri' => 'https://www.w3-edge.com/',
43
  'extension_uri' => 'https://www.w3-edge.com/',
44
  'extension_id' => 'genesis.theme',
 
45
  'version' => '0.1',
46
  'enabled' => empty( $requirements ),
47
  'requirements' => implode( ', ', $requirements ),
@@ -121,7 +122,7 @@ class Extension_Genesis_Plugin_Admin {
121
  $extension_id = 'genesis.theme';
122
 
123
  $notes[$extension_id] = sprintf(
124
- __( 'It appears that activating the <a href="%s">Genesis Theme</a> extension for W3 Total Cache will be helpful for your site. <a href="%s">Click here</a> to try it. %s',
125
  'w3-total-cache' ),
126
  Util_Ui::admin_url( 'admin.php?page=w3tc_extensions#' . $extension_id ),
127
  Util_Ui::url( array( 'w3tc_extensions_activate' => $extension_id ) ),
42
  'author_uri' => 'https://www.w3-edge.com/',
43
  'extension_uri' => 'https://www.w3-edge.com/',
44
  'extension_id' => 'genesis.theme',
45
+ 'settings_exists' => true,
46
  'version' => '0.1',
47
  'enabled' => empty( $requirements ),
48
  'requirements' => implode( ', ', $requirements ),
122
  $extension_id = 'genesis.theme';
123
 
124
  $notes[$extension_id] = sprintf(
125
+ __( 'Activating the <a href="%s">Genesis Theme</a> extension for W3 Total Cache may be helpful for your site. <a href="%s">Click here</a> to try it. %s',
126
  'w3-total-cache' ),
127
  Util_Ui::admin_url( 'admin.php?page=w3tc_extensions#' . $extension_id ),
128
  Util_Ui::url( array( 'w3tc_extensions_activate' => $extension_id ) ),
Extension_NewRelic_Page_View_Apm.php CHANGED
@@ -151,7 +151,7 @@ _e( 'Select user roles that <acronym title="Real User Monitoring">RUM</acronym>
151
  <tr>
152
  <th>
153
  <label for="newrelic_include_rum"><?php
154
- _e( 'Include <acronym title="Real User Monitoring">RUM</acronym> in compressed or cached pages', 'w3-total-cache' )
155
  ?></label>
156
  </th>
157
  <td>
@@ -170,7 +170,7 @@ _e( 'Include <acronym title="Real User Monitoring">RUM</acronym> in compressed o
170
  <tr>
171
  <th>
172
  <label for="newrelic_use_php_function"><?php
173
- _e( 'Use PHP function to set application name:', 'w3-total-cache' )
174
  ?></label></th>
175
  <td>
176
  <?php if ( Util_Environment::is_wpmu() ): ?>
@@ -189,7 +189,7 @@ _e( 'Use PHP function to set application name:', 'w3-total-cache' )
189
  <tr>
190
  <th>
191
  <label for="newrelic_enable_xmit"><?php
192
- _e( 'Enable XMIT', 'w3-total-cache' )
193
  ?></label>
194
  </th>
195
  <td><input name="" type="hidden" value="0" />
151
  <tr>
152
  <th>
153
  <label for="newrelic_include_rum"><?php
154
+ _e( 'Include <acronym title="Real User Monitoring">RUM</acronym> in compressed or cached pages:', 'w3-total-cache' )
155
  ?></label>
156
  </th>
157
  <td>
170
  <tr>
171
  <th>
172
  <label for="newrelic_use_php_function"><?php
173
+ _e( 'Use <acronym title=\"Hypertext Preprocessor\">PHP</acronym> function to set application name:', 'w3-total-cache' )
174
  ?></label></th>
175
  <td>
176
  <?php if ( Util_Environment::is_wpmu() ): ?>
189
  <tr>
190
  <th>
191
  <label for="newrelic_enable_xmit"><?php
192
+ _e( 'Enable XMIT:', 'w3-total-cache' )
193
  ?></label>
194
  </th>
195
  <td><input name="" type="hidden" value="0" />
Extension_NewRelic_Plugin_Admin.php CHANGED
@@ -21,6 +21,7 @@ class Extension_NewRelic_Plugin_Admin {
21
  'author_uri' => 'https://www.w3-edge.com/',
22
  'extension_uri' => 'https://www.w3-edge.com/',
23
  'extension_id' => 'newrelic',
 
24
  'version' => '1.0',
25
  'enabled' => true,
26
  'requirements' => '',
21
  'author_uri' => 'https://www.w3-edge.com/',
22
  'extension_uri' => 'https://www.w3-edge.com/',
23
  'extension_id' => 'newrelic',
24
+ 'settings_exists' => true,
25
  'version' => '1.0',
26
  'enabled' => true,
27
  'requirements' => '',
Extension_WordPressSeo_Plugin_Admin.php CHANGED
@@ -44,13 +44,14 @@ class Extension_WordPressSeo_Plugin_Admin {
44
  $message[] = 'Optimizes "Yoast SEO" plugin, which is not active';
45
 
46
  $extensions['wordpress-seo'] = array (
47
- 'name' => 'WordPress SEO by Yoast',
48
  'author' => 'W3 EDGE',
49
  'description' => __( 'Configures W3 Total Cache to comply with Yoast SEO requirements automatically.', 'w3-total-cache' ),
50
 
51
  'author_uri' => 'https://www.w3-edge.com/',
52
  'extension_uri' => 'https://www.w3-edge.com/',
53
  'extension_id' => 'wordpress-seo',
 
54
  'version' => '0.1',
55
  'enabled' => self::criteria_match(),
56
  'requirements' => implode( ', ', $message ),
@@ -96,7 +97,7 @@ class Extension_WordPressSeo_Plugin_Admin {
96
  $extension_id = 'wordpress-seo';
97
 
98
  $notes[$extension_id] = sprintf(
99
- __( 'It appears that activating the <a href="%s">Yoast SEO</a> extension for W3 Total Cache will be helpful for your site. <a class="button" href="%s">Click here</a> to try it. %s',
100
  'w3-total-cache' ),
101
  Util_Ui::admin_url( 'admin.php?page=w3tc_extensions#' . $extension_id ),
102
  Util_Ui::url( array( 'w3tc_extensions_activate' => $extension_id ) ),
44
  $message[] = 'Optimizes "Yoast SEO" plugin, which is not active';
45
 
46
  $extensions['wordpress-seo'] = array (
47
+ 'name' => 'Yoast SEO',
48
  'author' => 'W3 EDGE',
49
  'description' => __( 'Configures W3 Total Cache to comply with Yoast SEO requirements automatically.', 'w3-total-cache' ),
50
 
51
  'author_uri' => 'https://www.w3-edge.com/',
52
  'extension_uri' => 'https://www.w3-edge.com/',
53
  'extension_id' => 'wordpress-seo',
54
+ 'settings_exists' => true,
55
  'version' => '0.1',
56
  'enabled' => self::criteria_match(),
57
  'requirements' => implode( ', ', $message ),
97
  $extension_id = 'wordpress-seo';
98
 
99
  $notes[$extension_id] = sprintf(
100
+ __( 'Activating the <a href="%s">Yoast SEO</a> extension for W3 Total Cache may be helpful for your site. <a class="button" href="%s">Click here</a> to try it. %s',
101
  'w3-total-cache' ),
102
  Util_Ui::admin_url( 'admin.php?page=w3tc_extensions#' . $extension_id ),
103
  Util_Ui::url( array( 'w3tc_extensions_activate' => $extension_id ) ),
Extension_Wpml_Plugin_Admin.php CHANGED
@@ -19,7 +19,7 @@ class Extension_Wpml_Plugin_Admin {
19
 
20
  if ( !$state->get_boolean( 'wpml.hide_note_language_negotiation_type' ) ) {
21
  $notes[] = sprintf(
22
- __( 'W3 Total Cache\'s Page caching can not work effectively when WPML Language URL format "Language name added as a parameter" used. Please consider another URL format, you may change it at WPML -&gt; Languages page. %s' ,
23
  'w3-total-cache' ),
24
  Util_Ui::button_hide_note2( array(
25
  'w3tc_default_config_state' => 'y',
@@ -39,7 +39,7 @@ class Extension_Wpml_Plugin_Admin {
39
 
40
  $requirements = array();
41
  if ( !$base_plugin_active )
42
- $requirements[] = 'Ensure "WPML" plugin compatibility, which is not active';
43
  if ( empty( $requirements ) && !Util_Environment::is_w3tc_pro( $config ) ) {
44
  $enabled = false;
45
  $requirements[] = 'Available after <a href="#" class="button-buy-plugin">upgrade</a>';
@@ -47,13 +47,14 @@ class Extension_Wpml_Plugin_Admin {
47
  }
48
 
49
  $extensions['wpml'] = array(
50
- 'name' => 'WPML.org',
51
  'author' => 'W3 EDGE',
52
- 'description' => __( 'Configures W3 Total Cache to comply with WPML requirements automatically.',
53
  'w3-total-cache' ),
54
  'author_uri' => 'https://www.w3-edge.com/',
55
  'extension_uri' => 'https://www.w3-edge.com/',
56
  'extension_id' => 'wpml',
 
57
  'version' => '0.1',
58
  'enabled' => $enabled,
59
  'disabled_message' => $disabled_message,
@@ -114,7 +115,7 @@ class Extension_Wpml_Plugin_Admin {
114
  }
115
 
116
  $notes[$extension_id] = sprintf(
117
- __( 'It appears that activating the <a href="%s">WPML</a> extension for W3 Total Cache will be helpful for your site. %s%s',
118
  'w3-total-cache' ),
119
  Util_Ui::admin_url( 'admin.php?page=w3tc_extensions#' . $extension_id ),
120
  $activate_text,
19
 
20
  if ( !$state->get_boolean( 'wpml.hide_note_language_negotiation_type' ) ) {
21
  $notes[] = sprintf(
22
+ __( 'W3 Total Cache\'s Page caching cannot work effectively when WPML Language URL formatis "Language name added as a parameter" used. Please consider another URL format. Visit the WPML -&gt; Languages settings. %s' ,
23
  'w3-total-cache' ),
24
  Util_Ui::button_hide_note2( array(
25
  'w3tc_default_config_state' => 'y',
39
 
40
  $requirements = array();
41
  if ( !$base_plugin_active )
42
+ $requirements[] = 'Ensure "WPML" plugin compatibility, which is not currently active.';
43
  if ( empty( $requirements ) && !Util_Environment::is_w3tc_pro( $config ) ) {
44
  $enabled = false;
45
  $requirements[] = 'Available after <a href="#" class="button-buy-plugin">upgrade</a>';
47
  }
48
 
49
  $extensions['wpml'] = array(
50
+ 'name' => 'WPML',
51
  'author' => 'W3 EDGE',
52
+ 'description' => __( 'Improves page caching interoperability with WPML.',
53
  'w3-total-cache' ),
54
  'author_uri' => 'https://www.w3-edge.com/',
55
  'extension_uri' => 'https://www.w3-edge.com/',
56
  'extension_id' => 'wpml',
57
+ 'settings_exists' => false,
58
  'version' => '0.1',
59
  'enabled' => $enabled,
60
  'disabled_message' => $disabled_message,
115
  }
116
 
117
  $notes[$extension_id] = sprintf(
118
+ __( 'Activating the <a href="%s">WPML</a> extension for W3 Total Cache may be helpful for your site. %s%s',
119
  'w3-total-cache' ),
120
  Util_Ui::admin_url( 'admin.php?page=w3tc_extensions#' . $extension_id ),
121
  $activate_text,
Extensions_Page.php CHANGED
@@ -3,6 +3,17 @@ namespace W3TC;
3
 
4
 
5
 
 
 
 
 
 
 
 
 
 
 
 
6
  class Extensions_Page extends Base_Page_Settings {
7
  /**
8
  * Current page
@@ -37,7 +48,6 @@ class Extensions_Page extends Base_Page_Settings {
37
 
38
  if ( $extension && $view ) {
39
  $all_settings = $this->_config->get_array( 'extensions.settings' );
40
- $extensions_active = Extensions_Util::get_active_extensions( $this->_config );
41
  $meta = $extensions_active[$extension];
42
  $sub_view = 'settings';
43
  } else {
@@ -45,6 +55,9 @@ class Extensions_Page extends Base_Page_Settings {
45
  $extensions_inactive = Extensions_Util::get_inactive_extensions( $this->_config );
46
  $var = "extensions_{$extension_status}";
47
  $extensions = $$var;
 
 
 
48
  $sub_view = 'list';
49
  $page = 1;
50
  }
3
 
4
 
5
 
6
+ /* todo - sort by name
7
+ function extensions_sort_cmp_name($a, $b)
8
+ {
9
+ if ($a['name'] == $b['name']) {
10
+ return 0;
11
+ }
12
+ return ($a['name'] < $b['name']) ? -1 : 1;
13
+ }*/
14
+
15
+
16
+
17
  class Extensions_Page extends Base_Page_Settings {
18
  /**
19
  * Current page
48
 
49
  if ( $extension && $view ) {
50
  $all_settings = $this->_config->get_array( 'extensions.settings' );
 
51
  $meta = $extensions_active[$extension];
52
  $sub_view = 'settings';
53
  } else {
55
  $extensions_inactive = Extensions_Util::get_inactive_extensions( $this->_config );
56
  $var = "extensions_{$extension_status}";
57
  $extensions = $$var;
58
+ $extension_keys = array_keys($extensions);
59
+ sort($extension_keys);
60
+
61
  $sub_view = 'list';
62
  $page = 1;
63
  }
Extensions_Plugin_Admin.php CHANGED
@@ -59,6 +59,10 @@ class Extensions_Plugin_Admin {
59
  '\W3TC\Extension_Wpml_Plugin_Admin',
60
  'w3tc_extensions' ),
61
  10, 2 );
 
 
 
 
62
  add_filter( 'w3tc_extensions_hooks', array(
63
  '\W3TC\Extension_Wpml_Plugin_Admin',
64
  'w3tc_extensions_hooks' ) );
59
  '\W3TC\Extension_Wpml_Plugin_Admin',
60
  'w3tc_extensions' ),
61
  10, 2 );
62
+ add_filter( 'w3tc_extensions', array(
63
+ '\W3TC\Extension_Amp_Plugin_Admin',
64
+ 'w3tc_extensions' ),
65
+ 10, 2 );
66
  add_filter( 'w3tc_extensions_hooks', array(
67
  '\W3TC\Extension_Wpml_Plugin_Admin',
68
  'w3tc_extensions_hooks' ) );
Generic_ConfigLabels.php CHANGED
@@ -14,7 +14,7 @@ class Generic_ConfigLabels {
14
  'common.force_master' => __( 'Use single network configuration file for all sites.', 'w3-total-cache' ),
15
  'config.path' => __( 'Nginx server configuration file path', 'w3-total-cache' ),
16
  'config.check' => __( 'Verify rewrite rules', 'w3-total-cache' ),
17
- 'plugin.license_key' => __( 'License', 'w3-total-cache' ),
18
 
19
  'referrer.enabled' => __( 'Referrers:', 'w3-total-cache' ),
20
  'referrer.rgroups' => __( 'Referrer groups', 'w3-total-cache' ),
14
  'common.force_master' => __( 'Use single network configuration file for all sites.', 'w3-total-cache' ),
15
  'config.path' => __( 'Nginx server configuration file path', 'w3-total-cache' ),
16
  'config.check' => __( 'Verify rewrite rules', 'w3-total-cache' ),
17
+ 'plugin.license_key' => __( 'License:', 'w3-total-cache' ),
18
 
19
  'referrer.enabled' => __( 'Referrers:', 'w3-total-cache' ),
20
  'referrer.rgroups' => __( 'Referrer groups', 'w3-total-cache' ),
Generic_Page_Dashboard_View.css CHANGED
@@ -2,11 +2,11 @@
2
  background-color: #FFF;
3
  margin:0;padding:0;
4
  }
5
- #w3tc-dashboard-widgets h3.hndle {
6
  height: 36px;
7
  line-height: 36px;
8
  }
9
- #w3tc-dashboard-widgets h3.hndle, #w3tc-dashboard-widgets h3.hndle span {
10
  font-family: Arial, sans-serif;
11
  font-weight: bold;
12
  text-shadow: none;
@@ -73,7 +73,7 @@
73
  padding-right: 10px;
74
  }
75
 
76
- .w3tc-widget-spreadtheword-logo {
77
  float: left;
78
  width: 50px;
79
  height: 35px;
@@ -102,10 +102,10 @@
102
  }
103
 
104
  .w3tc-widget-maxcdn-logo {
105
- float: left;
106
  width: 150px;
107
  height: 35px;
108
  background: url("pub/img/w3tc_maxcdn-logo.png") 0 5px no-repeat;
 
109
  }
110
 
111
  #normal-sortables .postbox {
@@ -115,6 +115,7 @@
115
  /**
116
  * HiDPI Displays
117
  */
 
118
  @media print,
119
  only screen and (-webkit-min-device-pixel-ratio: 2),
120
  only screen and ( min--moz-device-pixel-ratio: 2),
@@ -127,7 +128,7 @@ only screen and ( min-resolution: 2dppx) {
127
  background-size: 224px 44px;
128
  }
129
 
130
- .w3tc-widget-spreadtheword-logo {
131
  float: left;
132
  width: 50px;
133
  height: 90px;
@@ -167,3 +168,4 @@ only screen and ( min-resolution: 2dppx) {
167
  background-size: 468px 90px;
168
  }
169
  }
 
2
  background-color: #FFF;
3
  margin:0;padding:0;
4
  }
5
+ #w3tc-dashboard-widgets .hndle {
6
  height: 36px;
7
  line-height: 36px;
8
  }
9
+ #w3tc-dashboard-widgets .hndle, #w3tc-dashboard-widgets .hndle span {
10
  font-family: Arial, sans-serif;
11
  font-weight: bold;
12
  text-shadow: none;
73
  padding-right: 10px;
74
  }
75
 
76
+ .w3tc-widget-w3tc-logo {
77
  float: left;
78
  width: 50px;
79
  height: 35px;
102
  }
103
 
104
  .w3tc-widget-maxcdn-logo {
 
105
  width: 150px;
106
  height: 35px;
107
  background: url("pub/img/w3tc_maxcdn-logo.png") 0 5px no-repeat;
108
+ float: left;
109
  }
110
 
111
  #normal-sortables .postbox {
115
  /**
116
  * HiDPI Displays
117
  */
118
+ /* doesnt work
119
  @media print,
120
  only screen and (-webkit-min-device-pixel-ratio: 2),
121
  only screen and ( min--moz-device-pixel-ratio: 2),
128
  background-size: 224px 44px;
129
  }
130
 
131
+ .w3tc-widget-w3tc-logo {
132
  float: left;
133
  width: 50px;
134
  height: 90px;
168
  background-size: 468px 90px;
169
  }
170
  }
171
+ */
Generic_Plugin_Admin.php CHANGED
@@ -38,6 +38,9 @@ class Generic_Plugin_Admin {
38
  $this,
39
  'admin_init'
40
  ) );
 
 
 
41
 
42
  add_action( 'admin_enqueue_scripts', array(
43
  $this,
38
  $this,
39
  'admin_init'
40
  ) );
41
+ add_action( 'admin_init_w3tc_dashboard', array(
42
+ '\W3TC\Generic_WidgetServices',
43
+ 'admin_init_w3tc_dashboard' ) );
44
 
45
  add_action( 'admin_enqueue_scripts', array(
46
  $this,
Generic_Plugin_AdminNotifications.php CHANGED
@@ -110,7 +110,7 @@ class Generic_Plugin_AdminNotifications {
110
  public function w3tc_ajax_generic_support_us() {
111
  $supports = $this->get_supports();
112
  global $current_user;
113
- get_currentuserinfo();
114
  $email = $current_user->user_email;
115
  include W3TC_INC_DIR . '/lightbox/support_us.php';
116
  }
110
  public function w3tc_ajax_generic_support_us() {
111
  $supports = $this->get_supports();
112
  global $current_user;
113
+ wp_get_current_user();
114
  $email = $current_user->user_email;
115
  include W3TC_INC_DIR . '/lightbox/support_us.php';
116
  }
Generic_Plugin_WidgetServices.php → Generic_WidgetServices.php RENAMED
@@ -9,54 +9,79 @@ namespace W3TC;
9
  /**
10
  * Class Generic_Plugin_WidgetServices
11
  */
12
- class Generic_Plugin_WidgetServices {
13
- /**
14
- * Array of request types
15
- *
16
- * @var array
17
- */
18
- var $_request_types = array();
19
- var $_json_request_types = array();
20
 
21
  /**
22
- * Array of request groups
23
  *
24
- * @var array
25
  */
26
- var $_request_groups = array(
27
- 'email_support',
28
- 'phone_support',
29
- 'plugin_config',
30
- 'theme_config',
31
- 'linux_config'
32
- );
33
 
34
- /**
35
- * Request price list
36
- *
37
- * @var array
38
- */
39
- var $_request_prices = array(
40
- 'email_support' => 175,
41
- 'phone_support' => 250,
42
- 'plugin_config' => 200,
43
- 'theme_config' => 350,
44
- 'linux_config' => 450
45
- );
46
 
47
- /**
48
- * Config
49
- */
50
- private $_config = null;
 
 
 
 
 
51
 
52
- function __construct() {
53
- $this->_config = Dispatcher::config();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
54
  }
55
 
56
- /**
57
- * Runs plugin
58
- */
59
- function run() {
 
 
 
 
 
 
 
 
 
60
  if ( Util_Admin::get_current_wp_page() == 'w3tc_dashboard' )
61
  add_action( 'admin_enqueue_scripts', array( $this, 'enqueue' ) );
62
 
@@ -74,64 +99,14 @@ class Generic_Plugin_WidgetServices {
74
  'theme_config' => sprintf( __( 'Theme Performance Optimization & Plugin Configuration %s', 'w3-total-cache' ), '<br /><span>Starting @ $350 USD</span>' ),
75
  'linux_config' => sprintf( __( 'Linux Server Optimization & Plugin Configuration %s', 'w3-total-cache' ), '<br /><span>Starting @ $450 USD</span>' )
76
  );
77
- add_action( 'w3tc_widget_setup', array(
78
- $this,
79
- 'wp_dashboard_setup'
80
- ) );
81
- add_action( 'w3tc_network_dashboard_setup', array(
82
- $this,
83
- 'wp_dashboard_setup'
84
- ) );
85
-
86
- if ( is_admin() ) {
87
- add_action( 'wp_ajax_w3tc_action_payment_code', array( $this, 'action_payment_code' ) );
88
- }
89
- }
90
-
91
- /**
92
- * Dashboard setup action
93
- *
94
- * @return void
95
- */
96
- function wp_dashboard_setup() {
97
- Util_Widget::add( 'w3tc_services',
98
- '<div class="w3tc-widget-services-logo"></div>' .
99
- '<div class="w3tc-widget-text">' .
100
- __( 'Premium Services', 'w3-total-cache' ) .
101
- '</div>',
102
- array( $this, 'widget_form' ),
103
- null, 'normal' );
104
- }
105
 
106
  function widget_form() {
107
  include W3TC_INC_WIDGET_DIR . '/services.php';
108
  }
109
 
110
- function action_payment_code() {
111
-
112
-
113
- $request_type = Util_Request::get_string( 'request_type' );
114
-
115
- $request_id = date( 'YmdHi' );
116
- $return_url = admin_url( 'admin.php?page=w3tc_support&request_type=' . $request_type . '&payment=1&request_id=' . $request_id );
117
- $cancel_url = admin_url( 'admin.php?page=w3tc_dashboard' );
118
- $form_values = array(
119
- "cmd" => "_xclick",
120
- "business" => W3TC_PAYPAL_BUSINESS,
121
- "item_name" => esc_attr( sprintf( '%s: %s (#%s)', ucfirst( Util_Environment::host() ), $this->_json_request_types[$request_type], $request_id ) ),
122
- "amount" => sprintf( '%.2f', $this->_request_prices[$request_type] ),
123
- "currency_code" => "USD",
124
- "no_shipping" => "1",
125
- "rm" => "2",
126
- "return" => esc_attr( $return_url ),
127
- "cancel_return" => esc_attr( $cancel_url ) );
128
- echo json_encode( $form_values );
129
- die();
130
- }
131
-
132
  public function enqueue() {
133
  wp_enqueue_style( 'w3tc-widget' );
134
  wp_enqueue_script( 'w3tc-metadata' );
135
  wp_enqueue_script( 'w3tc-widget' );
136
- }
137
  }
9
  /**
10
  * Class Generic_Plugin_WidgetServices
11
  */
12
+ class Generic_WidgetServices {
13
+ function __construct() {
14
+ }
 
 
 
 
 
15
 
16
  /**
17
+ * Dashboard setup action
18
  *
19
+ * @return void
20
  */
21
+ static public function admin_init_w3tc_dashboard() {
22
+ $o = new Generic_WidgetServices();
 
 
 
 
 
23
 
24
+ add_action( 'w3tc_widget_setup', array( $o, 'wp_dashboard_setup' ), 3 );
25
+ add_action( 'w3tc_network_dashboard_setup',
26
+ array( $o, 'wp_dashboard_setup' ), 3 );
27
+ }
 
 
 
 
 
 
 
 
28
 
29
+ function wp_dashboard_setup() {
30
+ Util_Widget::add( 'w3tc_services',
31
+ '<div class="w3tc-widget-w3tc-logo"></div>' .
32
+ '<div class="w3tc-widget-text">' .
33
+ __( 'Premium Services', 'w3-total-cache' ) .
34
+ '</div>',
35
+ array( $this, 'widget_form' ),
36
+ null, 'normal' );
37
+ }
38
 
39
+
40
+
41
+ public function load_request_types() {
42
+ $v = get_site_option( 'w3tc_generic_widgetservices' );
43
+ try {
44
+ $v = json_decode( $v, true );
45
+ if ( isset( $v['items'] ) && isset( $v['expires'] ) &&
46
+ $v['expires'] > time() )
47
+ return $v['items'];
48
+ } catch ( \Exception $e ) {
49
+ }
50
+
51
+
52
+ $result = wp_remote_request( W3TC_SUPPORT_SERVICES_URL,
53
+ array( 'method' => 'GET' ) );
54
+
55
+ if ( is_wp_error( $result ) )
56
+ return null;
57
+
58
+ $response_json = json_decode( $result['body'], true );
59
+
60
+ if ( is_null( $response_json ) || !isset( $response_json['items'] ) )
61
+ return null;
62
+
63
+ update_site_option( 'w3tc_generic_widgetservices',
64
+ json_encode( array(
65
+ 'items' => $response_json['items'],
66
+ 'expires' => time() + 3600 * 24 * 7
67
+ ) ) );
68
+
69
+ return $response_json['items'];
70
  }
71
 
72
+
73
+
74
+ public function widget_form() {
75
+ $items = $this->load_request_types();
76
+
77
+ include W3TC_DIR . '/Generic_WidgetServices_View.php';
78
+ }
79
+
80
+ /*
81
+ wp_enqueue_style( 'w3tc-widget-newrelic',
82
+ plugins_url( 'Extension_NewRelic_Widget_View.css', W3TC_FILE ),
83
+ array(), W3TC_VERSION );
84
+
85
  if ( Util_Admin::get_current_wp_page() == 'w3tc_dashboard' )
86
  add_action( 'admin_enqueue_scripts', array( $this, 'enqueue' ) );
87
 
99
  'theme_config' => sprintf( __( 'Theme Performance Optimization & Plugin Configuration %s', 'w3-total-cache' ), '<br /><span>Starting @ $350 USD</span>' ),
100
  'linux_config' => sprintf( __( 'Linux Server Optimization & Plugin Configuration %s', 'w3-total-cache' ), '<br /><span>Starting @ $450 USD</span>' )
101
  );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
102
 
103
  function widget_form() {
104
  include W3TC_INC_WIDGET_DIR . '/services.php';
105
  }
106
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
107
  public function enqueue() {
108
  wp_enqueue_style( 'w3tc-widget' );
109
  wp_enqueue_script( 'w3tc-metadata' );
110
  wp_enqueue_script( 'w3tc-widget' );
111
+ }*/
112
  }
Generic_WidgetServices_View.php ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace W3TC;
3
+
4
+ if ( !defined( 'W3TC' ) )
5
+ die();
6
+
7
+ ?>
8
+ <form action="admin.php" xmlns="http://www.w3.org/1999/html" method="get">
9
+ <input type="hidden" name="page" value="w3tc_support" />
10
+
11
+ <ul>
12
+ <?php
13
+ for ( $n = 0; $n < count( $items ); $n++ ): ?>
14
+ <li>
15
+ <div class="w3tc_generic_widgetservice_radio_outer">
16
+ <input id="service<?php echo $n ?>"
17
+ type="radio"
18
+ class="w3tc_generic_widgetservice_radio w3tc-ignore-change"
19
+ name="service_item"
20
+ value="<?php echo $n ?>"
21
+ />
22
+ </div>
23
+ <label for="service<?php echo $n ?>" class="w3tc_generic_widgetservice_label">
24
+ <?php echo htmlspecialchars( $items[$n]['name'] ) ?>
25
+ </label>
26
+ </li>
27
+ <?php endfor ?>
28
+ </ul>
29
+ <div id="buy-w3-service-area"></div>
30
+ <p>
31
+ <input id="buy-w3-service" name="buy-w3-service" type="submit"
32
+ class="button button-primary button-large"
33
+ value="<?php _e( 'Buy now', 'w3-total-cache' ) ?>" />
34
+ </p>
35
+ </form>
Generic_WidgetSpreadTheWord_Plugin.php CHANGED
@@ -43,9 +43,9 @@ class Generic_WidgetSpreadTheWord_Plugin {
43
  */
44
  function wp_dashboard_setup() {
45
  Util_Widget::add( 'w3tc_spreadtheword',
46
- '<div class="w3tc-widget-spreadtheword-logo"></div>' .
47
  '<div class="w3tc-widget-text">' .
48
- __( 'Spread The Word', 'w3-total-cache' ) .
49
  '</div>',
50
  array( $this, 'widget_form' ),
51
  null,
@@ -90,7 +90,7 @@ class Generic_WidgetSpreadTheWord_Plugin {
90
  if ( $value ) {
91
  _e( 'Thank you for linking to us!', 'w3-total-cache' );
92
  } else {
93
- _e( 'You are no longer linking to us. Please support us in other ways instead.', 'w3-total-cache' );
94
  }
95
  die();
96
  }
43
  */
44
  function wp_dashboard_setup() {
45
  Util_Widget::add( 'w3tc_spreadtheword',
46
+ '<div class="w3tc-widget-w3tc-logo"></div>' .
47
  '<div class="w3tc-widget-text">' .
48
+ __( 'Spread the Word', 'w3-total-cache' ) .