W3TCGeneric_Plugin

W3 Total Cache plugin.

Defined (1)

The class is defined in the following location(s).

/Generic_Plugin.php  
  1. class Generic_Plugin { 
  2.  
  3. private $_translations = array(); 
  4. /** 
  5. * Config 
  6. */ 
  7. private $_config = null; 
  8.  
  9. function __construct() { 
  10. $this->_config = Dispatcher::config(); 
  11.  
  12. /** 
  13. * Runs plugin 
  14. */ 
  15. function run() { 
  16. add_filter( 'cron_schedules', array( 
  17. $this,  
  18. 'cron_schedules' 
  19. ), 5 ); 
  20.  
  21. add_action( 'init', array( 
  22. $this,  
  23. 'init' 
  24. ), 1 /** need that to run before wp-cron to issue w3tc redirect */ ); 
  25. if ( Util_Environment::is_w3tc_pro_dev() && Util_Environment::is_w3tc_pro( $this->_config ) ) 
  26. add_action( 'wp_footer', array( $this, 'pro_dev_mode' ) ); 
  27.  
  28. add_action( 'admin_bar_menu', array( 
  29. $this,  
  30. 'admin_bar_menu' 
  31. ), 150 ); 
  32.  
  33. if ( isset( $_REQUEST['w3tc_theme'] ) && isset( $_SERVER['HTTP_USER_AGENT'] ) && 
  34. stristr( $_SERVER['HTTP_USER_AGENT'], W3TC_POWERED_BY ) !== false ) { 
  35. add_filter( 'template', array( 
  36. $this,  
  37. 'template_preview' 
  38. ) ); 
  39.  
  40. add_filter( 'stylesheet', array( 
  41. $this,  
  42. 'stylesheet_preview' 
  43. ) ); 
  44. } elseif ( $this->_config->get_boolean( 'mobile.enabled' ) || $this->_config->get_boolean( 'referrer.enabled' ) ) { 
  45. add_filter( 'template', array( 
  46. $this,  
  47. 'template' 
  48. ) ); 
  49.  
  50. add_filter( 'stylesheet', array( 
  51. $this,  
  52. 'stylesheet' 
  53. ) ); 
  54.  
  55. /** 
  56. * Create cookies to flag if a pgcache role was loggedin 
  57. */ 
  58. if ( !$this->_config->get_boolean( 'pgcache.reject.logged' ) && $this->_config->get_array( 'pgcache.reject.logged_roles' ) ) { 
  59. add_action( 'set_logged_in_cookie', array( 
  60. $this,  
  61. 'check_login_action' 
  62. ), 0, 5 ); 
  63. add_action( 'clear_auth_cookie', array( 
  64. $this,  
  65. 'check_login_action' 
  66. ), 0, 5 ); 
  67.  
  68. if ( $this->_config->get_string( 'common.support' ) == 'footer' ) { 
  69. add_action( 'wp_footer', array( 
  70. $this,  
  71. 'footer' 
  72. ) ); 
  73.  
  74. if ( $this->can_ob() ) { 
  75. ob_start( array( 
  76. $this,  
  77. 'ob_callback' 
  78. ) ); 
  79.  
  80. /** 
  81. * Cron schedules filter 
  82. * @param array $schedules 
  83. * @return array 
  84. */ 
  85. function cron_schedules( $schedules ) { 
  86. // Sets default values which are overriden by apropriate plugins 
  87. // if they are enabled 
  88. // 
  89. // absense of keys (if e.g. pgcaching became disabled, but there is 
  90. // cron event scheduled in db) causes PHP notices 
  91. return array_merge( $schedules, array( 
  92. 'w3_cdn_cron_queue_process' => array( 
  93. 'interval' => 0,  
  94. 'display' => '[W3TC] CDN queue process (disabled)' 
  95. ),  
  96. 'w3_cdn_cron_upload' => array( 
  97. 'interval' => 0,  
  98. 'display' => '[W3TC] CDN auto upload (disabled)' 
  99. ),  
  100. 'w3_dbcache_cleanup' => array( 
  101. 'interval' => 0,  
  102. 'display' => '[W3TC] Database Cache file GC (disabled)' 
  103. ),  
  104. 'w3_fragmentcache_cleanup' => array( 
  105. 'interval' => 0,  
  106. 'display' => '[W3TC] Fragment Cache file GC (disabled)' 
  107. ),  
  108. 'w3_minify_cleanup' => array( 
  109. 'interval' => 0,  
  110. 'display' => '[W3TC] Minify file GC (disabled)' 
  111. ),  
  112. 'w3_objectcache_cleanup' => array( 
  113. 'interval' => 0,  
  114. 'display' => '[W3TC] Object Cache file GC (disabled)' 
  115. ),  
  116. 'w3_pgcache_cleanup' => array( 
  117. 'interval' => 0,  
  118. 'display' => '[W3TC] Page Cache file GC (disabled)' 
  119. ),  
  120. 'w3_pgcache_prime' => array( 
  121. 'interval' => 0,  
  122. 'display' => '[W3TC] Page Cache file GC (disabled)' 
  123. ) ); 
  124.  
  125. /** 
  126. * Init action 
  127. * @return void 
  128. */ 
  129. function init() { 
  130. // Load plugin text domain 
  131. load_plugin_textdomain( W3TC_TEXT_DOMAIN, null, plugin_basename( W3TC_DIR ) . '/languages/' ); 
  132.  
  133. if ( is_multisite() && !is_network_admin() ) { 
  134. global $w3_current_blog_id, $current_blog; 
  135. if ( $w3_current_blog_id != $current_blog->blog_id && !isset( $GLOBALS['w3tc_blogmap_register_new_item'] ) ) { 
  136. $url = Util_Environment::host_port() . $_SERVER['REQUEST_URI']; 
  137. $pos = strpos( $url, '?' ); 
  138. if ( $pos !== false ) 
  139. $url = substr( $url, 0, $pos ); 
  140. $GLOBALS['w3tc_blogmap_register_new_item'] = $url; 
  141.  
  142. if ( isset( $GLOBALS['w3tc_blogmap_register_new_item'] ) ) { 
  143. $do_redirect = false; 
  144. // true value is a sign to just generate config cache 
  145. if ( $GLOBALS['w3tc_blogmap_register_new_item'] != 'cache_options' ) { 
  146. if ( Util_Environment::is_wpmu_subdomain() ) 
  147. $blog_home_url = $GLOBALS['w3tc_blogmap_register_new_item']; 
  148. else { 
  149. $home_url = rtrim( get_home_url(), '/' ); 
  150. if ( substr( $home_url, 0, 7 ) == 'http://' ) 
  151. $home_url = substr( $home_url, 7 ); 
  152. else if ( substr( $home_url, 0, 8 ) == 'https://' ) 
  153. $home_url = substr( $home_url, 8 ); 
  154.  
  155. if ( substr( $GLOBALS['w3tc_blogmap_register_new_item'], 0,  
  156. strlen( $home_url ) ) == $home_url ) 
  157. $blog_home_url = $home_url; 
  158. else 
  159. $blog_home_url = $GLOBALS['w3tc_blogmap_register_new_item']; 
  160.  
  161.  
  162. $do_redirect = Util_WpmuBlogmap::register_new_item( $blog_home_url,  
  163. $this->_config ); 
  164.  
  165. // reset cache of blog_id 
  166. global $w3_current_blog_id; 
  167. $w3_current_blog_id = null; 
  168.  
  169. // change config to actual blog, it was master before 
  170. $this->_config = new Config(); 
  171.  
  172. // fix environment, potentially it's first request to a specific blog 
  173. $environment = Dispatcher::component( 'Root_Environment' ); 
  174. $environment->fix_on_event( $this->_config, 'first_frontend',  
  175. $this->_config ); 
  176.  
  177. // need to repeat request processing, since we was not able to realize 
  178. // blog_id before so we are running with master config now. 
  179. // redirect to the same url causes "redirect loop" error in browser,  
  180. // so need to redirect to something a bit different 
  181. if ( $do_redirect ) { 
  182. if ( strpos( $_SERVER['REQUEST_URI'], '?' ) === false ) 
  183. Util_Environment::redirect_temp( $_SERVER['REQUEST_URI'] . '?repeat=w3tc' ); 
  184. else { 
  185. if ( strpos( $_SERVER['REQUEST_URI'], 'repeat=w3tc' ) === false ) 
  186. Util_Environment::redirect_temp( $_SERVER['REQUEST_URI'] . '&repeat=w3tc' ); 
  187.  
  188. /** 
  189. * Check for rewrite test request 
  190. */ 
  191. $rewrite_test = Util_Request::get_boolean( 'w3tc_rewrite_test' ); 
  192.  
  193. if ( $rewrite_test ) { 
  194. echo 'OK'; 
  195. exit(); 
  196. $admin_bar = false; 
  197. if ( function_exists( 'is_admin_bar_showing' ) ) 
  198. $admin_bar = is_admin_bar_showing(); 
  199.  
  200. if ( $admin_bar ) { 
  201. add_action( 'wp_print_scripts', array( $this, 'popup_script' ) ); 
  202.  
  203.  
  204. // dont add system stuff to search results 
  205. if ( ( isset( $_GET['repeat'] ) && $_GET['repeat'] == 'w3tc' ) || 
  206. Util_Environment::is_preview_mode() ) { 
  207. header( 'X-Robots-Tag: noindex' ); 
  208.  
  209. /** 
  210. * Admin bar menu 
  211. * @return void 
  212. */ 
  213. function admin_bar_menu() { 
  214. global $wp_admin_bar; 
  215.  
  216. $base_capability = apply_filters( 'w3tc_capability_admin_bar',  
  217. 'manage_options' ); 
  218.  
  219. if ( current_user_can( $base_capability ) ) { 
  220. $modules = Dispatcher::component( 'ModuleStatus' ); 
  221.  
  222. $menu_postfix = ''; 
  223. if ( !is_admin() && 
  224. $this->_config->get_boolean( 'widget.pagespeed.show_in_admin_bar' ) ) { 
  225. $menu_postfix = ' <span id="w3tc_monitoring_score">...</span>'; 
  226. add_action( 'wp_after_admin_bar_render',  
  227. array( $this, 'wp_after_admin_bar_render' ) ); 
  228.  
  229. $menu_items = array(); 
  230.  
  231. $menu_items['00010.generic'] = array( 
  232. 'id' => 'w3tc',  
  233. 'title' => 
  234. '<img src="' . 
  235. plugins_url( 'pub/img/w3tc-sprite-admin-bar.png', W3TC_FILE ) . 
  236. '" style="vertical-align:middle; margin-right:5px; width: 29px; height: 29px" />' . 
  237. __( 'Performance', 'w3-total-cache' ) . 
  238. $menu_postfix,  
  239. 'href' => network_admin_url( 'admin.php?page=w3tc_dashboard' ) 
  240. ); 
  241.  
  242. if ( $modules->plugin_is_enabled() ) { 
  243. $menu_items['10010.generic'] = array( 
  244. 'id' => 'w3tc_flush_all',  
  245. 'parent' => 'w3tc',  
  246. 'title' => __( 'Purge All Caches', 'w3-total-cache' ),  
  247. 'href' => wp_nonce_url( network_admin_url( 
  248. 'admin.php?page=w3tc_dashboard&w3tc_flush_all' ),  
  249. 'w3tc' ) 
  250. ); 
  251. if ( !is_admin() ) 
  252. $menu_items['10020.generic'] = array( 
  253. 'id' => 'w3tc_flush_current_page',  
  254. 'parent' => 'w3tc',  
  255. 'title' => __( 'Purge Current Page', 'w3-total-cache' ),  
  256. 'href' => wp_nonce_url( admin_url( 
  257. 'admin.php?page=w3tc_dashboard&w3tc_flush_current_page' ),  
  258. 'w3tc' ) 
  259. ); 
  260.  
  261. $menu_items['20010.generic'] = array( 
  262. 'id' => 'w3tc_flush',  
  263. 'parent' => 'w3tc',  
  264. 'title' => __( 'Purge Modules', 'w3-total-cache' ) 
  265. ); 
  266.  
  267. $menu_items['40010.generic'] = array( 
  268. 'id' => 'w3tc_settings_general',  
  269. 'parent' => 'w3tc',  
  270. 'title' => __( 'General Settings', 'w3-total-cache' ),  
  271. 'href' => wp_nonce_url( network_admin_url( 'admin.php?page=w3tc_general' ), 'w3tc' ) 
  272. ); 
  273. $menu_items['40020.generic'] = array( 
  274. 'id' => 'w3tc_settings_extensions',  
  275. 'parent' => 'w3tc',  
  276. 'title' => __( 'Manage Extensions', 'w3-total-cache' ),  
  277. 'href' => wp_nonce_url( network_admin_url( 'admin.php?page=w3tc_extensions' ), 'w3tc' ) 
  278. ); 
  279.  
  280. $menu_items['40030.generic'] = array( 
  281. 'id' => 'w3tc_settings_faq',  
  282. 'parent' => 'w3tc',  
  283. 'title' => __( 'FAQ', 'w3-total-cache' ),  
  284. 'href' => wp_nonce_url( network_admin_url( 'admin.php?page=w3tc_faq' ), 'w3tc' ) 
  285. ); 
  286.  
  287. $menu_items['60010.generic'] = array( 
  288. 'id' => 'w3tc_support',  
  289. 'parent' => 'w3tc',  
  290. 'title' => __( 'Support', 'w3-total-cache' ),  
  291. 'href' => network_admin_url( 'admin.php?page=w3tc_support' ) 
  292. ); 
  293.  
  294. if ( defined( 'W3TC_DEBUG' ) && W3TC_DEBUG ) { 
  295. $menu_items['90010.generic'] = array( 
  296. 'id' => 'w3tc_debug_overlays',  
  297. 'parent' => 'w3tc',  
  298. 'title' => __( 'Debug: Overlays', 'w3-total-cache' ),  
  299. ); 
  300. $menu_items['90020.generic'] = array( 
  301. 'id' => 'w3tc_overlay_support_us',  
  302. 'parent' => 'w3tc_debug_overlays',  
  303. 'title' => __( 'Support Us', 'w3-total-cache' ),  
  304. 'href' => wp_nonce_url( network_admin_url( 
  305. 'admin.php?page=w3tc_dashboard&' . 
  306. 'w3tc_message_action=generic_support_us' ), 'w3tc' ) 
  307. ); 
  308. $menu_items['60030.generic'] = array( 
  309. 'id' => 'w3tc_overlay_edge',  
  310. 'parent' => 'w3tc_debug_overlays',  
  311. 'title' => __( 'Edge', 'w3-total-cache' ),  
  312. 'href' => wp_nonce_url( network_admin_url( 
  313. 'admin.php?page=w3tc_dashboard&' . 
  314. 'w3tc_message_action=generic_edge' ), 'w3tc' ) 
  315. ); 
  316.  
  317. $menu_items = apply_filters( 'w3tc_admin_bar_menu', $menu_items ); 
  318.  
  319. $keys = array_keys( $menu_items ); 
  320. asort( $keys ); 
  321.  
  322. foreach ( $keys as $key ) { 
  323. $capability = apply_filters( 
  324. 'w3tc_capability_admin_bar_' . $menu_items[$key]['id'],  
  325. $base_capability ); 
  326.  
  327. if ( current_user_can( $capability ) ) 
  328. $wp_admin_bar->add_menu( $menu_items[$key] ); 
  329.  
  330. public function wp_after_admin_bar_render() { 
  331. $url = admin_url( 'admin-ajax.php', 'relative' ) . 
  332. '?action=w3tc_monitoring_score&' . md5( $_SERVER['REQUEST_URI'] ); 
  333.  
  334. ?> 
  335. <script type= "text/javascript"> 
  336. var w3tc_monitoring_score = document.createElement('script'); 
  337. w3tc_monitoring_score.type = 'text/javascript'; 
  338. w3tc_monitoring_score.src = '<?php echo $url ?>'; 
  339. document.getElementsByTagName('HEAD')[0].appendChild(w3tc_monitoring_score); 
  340. </script> 
  341. <?php 
  342.  
  343. /** 
  344. * Template filter 
  345. * @param unknown $template 
  346. * @return string 
  347. */ 
  348. function template( $template ) { 
  349. $w3_mobile = Dispatcher::component( 'Mobile_UserAgent' ); 
  350.  
  351. $mobile_template = $w3_mobile->get_template(); 
  352.  
  353. if ( $mobile_template ) { 
  354. return $mobile_template; 
  355. } else { 
  356. $w3_referrer = Dispatcher::component( 'Mobile_Referrer' ); 
  357.  
  358. $referrer_template = $w3_referrer->get_template(); 
  359.  
  360. if ( $referrer_template ) { 
  361. return $referrer_template; 
  362.  
  363. return $template; 
  364.  
  365. /** 
  366. * Stylesheet filter 
  367. * @param unknown $stylesheet 
  368. * @return string 
  369. */ 
  370. function stylesheet( $stylesheet ) { 
  371. $w3_mobile = Dispatcher::component( 'Mobile_UserAgent' ); 
  372.  
  373. $mobile_stylesheet = $w3_mobile->get_stylesheet(); 
  374.  
  375. if ( $mobile_stylesheet ) { 
  376. return $mobile_stylesheet; 
  377. } else { 
  378. $w3_referrer = Dispatcher::component( 'Mobile_Referrer' ); 
  379.  
  380. $referrer_stylesheet = $w3_referrer->get_stylesheet(); 
  381.  
  382. if ( $referrer_stylesheet ) { 
  383. return $referrer_stylesheet; 
  384.  
  385. return $stylesheet; 
  386.  
  387. /** 
  388. * Template filter 
  389. * @param unknown $template 
  390. * @return string 
  391. */ 
  392. function template_preview( $template ) { 
  393. $theme_name = Util_Request::get_string( 'w3tc_theme' ); 
  394.  
  395. $theme = Util_Theme::get( $theme_name ); 
  396.  
  397. if ( $theme ) { 
  398. return $theme['Template']; 
  399.  
  400. return $template; 
  401.  
  402. /** 
  403. * Stylesheet filter 
  404. * @param unknown $stylesheet 
  405. * @return string 
  406. */ 
  407. function stylesheet_preview( $stylesheet ) { 
  408. $theme_name = Util_Request::get_string( 'w3tc_theme' ); 
  409.  
  410. $theme = Util_Theme::get( $theme_name ); 
  411.  
  412. if ( $theme ) { 
  413. return $theme['Stylesheet']; 
  414.  
  415. return $stylesheet; 
  416.  
  417. /** 
  418. * Footer plugin action 
  419. * @return void 
  420. */ 
  421. function footer() { 
  422. echo '<div style="text-align: center;"><a href="https://www.w3-edge.com/products/" rel="external">Optimization WordPress Plugins & Solutions by W3 EDGE</a></div>'; 
  423.  
  424. /** 
  425. * Output buffering callback 
  426. * @param string $buffer 
  427. * @return string 
  428. */ 
  429. function ob_callback( $buffer ) { 
  430. global $wpdb; 
  431.  
  432. global $w3_late_caching_succeeded; 
  433. if ( $w3_late_caching_succeeded ) { 
  434. return $buffer; 
  435.  
  436. if ( Util_Content::is_database_error( $buffer ) ) { 
  437. status_header( 503 ); 
  438. } else { 
  439. if ( Util_Content::can_print_comment( $buffer ) ) { 
  440. /** 
  441. * Add footer comment 
  442. */ 
  443. $date = date_i18n( 'Y-m-d H:i:s' ); 
  444. $host = ( !empty( $_SERVER['SERVER_NAME'] ) ? $_SERVER['SERVER_NAME'] : 'localhost' ); 
  445.  
  446. if ( Util_Environment::is_preview_mode() ) 
  447. $buffer .= "\r\n<!-- W3 Total Cache used in preview mode -->"; 
  448.  
  449. if ( $this->_config->get_string( 'common.support' ) != '' || 
  450. $this->_config->get_boolean( 'common.tweeted' ) ) { 
  451. $buffer .= sprintf( "\r\n<!-- Served from: %s @ %s by W3 Total Cache -->",  
  452. Util_Content::escape_comment( $host ), $date ); 
  453. } else { 
  454. $strings = array(); 
  455. $strings = apply_filters( 'w3tc_footer_comment', $strings ); 
  456.  
  457. $buffer .= "\r\n<!-- Performance optimized by W3 Total Cache. Learn more: https://www.w3-edge.com/products/\r\n"; 
  458.  
  459. if ( count( $strings ) ) { 
  460. $buffer .= "\r\n" . 
  461. Util_Content::escape_comment( implode( "\r\n", $strings ) ) . 
  462. "\r\n"; 
  463.  
  464. $buffer .= sprintf( "\r\n Served from: %s @ %s by W3 Total Cache -->", Util_Content::escape_comment( $host ), $date ); 
  465.  
  466. $buffer = apply_filters( 'w3tc_process_content', $buffer ); 
  467.  
  468. $buffer = Util_Bus::do_ob_callbacks( 
  469. array( 'swarmify', 'minify', 'newrelic', 'cdn', 'browsercache', 'pagecache' ),  
  470. $buffer ); 
  471.  
  472. return $buffer; 
  473.  
  474. /** 
  475. * Check if we can do modify contents 
  476. * @return boolean 
  477. */ 
  478. function can_ob() { 
  479. global $w3_late_init; 
  480. if ( $w3_late_init ) { 
  481. return false; 
  482.  
  483. /** 
  484. * Skip if doing AJAX 
  485. */ 
  486. if ( defined( 'DOING_AJAX' ) ) { 
  487. return false; 
  488.  
  489. /** 
  490. * Skip if doing cron 
  491. */ 
  492. if ( defined( 'DOING_CRON' ) ) { 
  493. return false; 
  494.  
  495. /** 
  496. * Skip if APP request 
  497. */ 
  498. if ( defined( 'APP_REQUEST' ) ) { 
  499. return false; 
  500.  
  501. /** 
  502. * Skip if XMLRPC request 
  503. */ 
  504. if ( defined( 'XMLRPC_REQUEST' ) ) { 
  505. return false; 
  506.  
  507. /** 
  508. * Check for WPMU's and WP's 3.0 short init 
  509. */ 
  510. if ( defined( 'SHORTINIT' ) && SHORTINIT ) { 
  511. return false; 
  512.  
  513. /** 
  514. * Check User Agent 
  515. */ 
  516. if ( isset( $_SERVER['HTTP_USER_AGENT'] ) && 
  517. stristr( $_SERVER['HTTP_USER_AGENT'], W3TC_POWERED_BY ) !== false ) { 
  518. return false; 
  519.  
  520. return true; 
  521.  
  522. /** 
  523. * User login hook 
  524. * Check if current user is not listed in pgcache.reject.* rules 
  525. * If so, set a role cookie so the requests wont be cached 
  526. */ 
  527. function check_login_action( $logged_in_cookie = false, $expire = ' ', $expiration = 0, $user_id = 0, $action = 'logged_out' ) { 
  528. $current_user = wp_get_current_user(); 
  529. if ( isset( $current_user->ID ) && !$current_user->ID ) 
  530. $user_id = new \WP_User( $user_id ); 
  531. else 
  532. $user_id = $current_user; 
  533.  
  534. if ( is_string( $user_id->roles ) ) { 
  535. $roles = array( $user_id->roles ); 
  536. } elseif ( !is_array( $user_id->roles ) || count( $user_id->roles ) <= 0 ) { 
  537. return; 
  538. } else { 
  539. $roles = $user_id->roles; 
  540.  
  541. $rejected_roles = $this->_config->get_array( 'pgcache.reject.roles' ); 
  542.  
  543. if ( 'logged_out' == $action ) { 
  544. foreach ( $rejected_roles as $role ) { 
  545. $role_hash = md5( NONCE_KEY . $role ); 
  546. setcookie( 'w3tc_logged_' . $role_hash, $expire,  
  547. time() - 31536000, COOKIEPATH, COOKIE_DOMAIN ); 
  548.  
  549. return; 
  550.  
  551. if ( 'logged_in' != $action ) 
  552. return; 
  553.  
  554. foreach ( $roles as $role ) { 
  555. if ( in_array( $role, $rejected_roles ) ) { 
  556. $role_hash = md5( NONCE_KEY . $role ); 
  557. setcookie( 'w3tc_logged_' . $role_hash, true, $expire,  
  558. COOKIEPATH, COOKIE_DOMAIN, is_ssl(), true ); 
  559.  
  560. function popup_script() { 
  561. ?> 
  562. <script type="text/javascript"> 
  563. function w3tc_popupadmin_bar(url) { 
  564. return window.open(url, '', 'width=800, height=600, status=no, toolbar=no, menubar=no, scrollbars=yes'); 
  565. </script> 
  566. <?php 
  567.  
  568. private function is_debugging() { 
  569. $debug = $this->_config->get_boolean( 'pgcache.enabled' ) && $this->_config->get_boolean( 'pgcache.debug' ); 
  570. $debug = $debug || ( $this->_config->get_boolean( 'dbcache.enabled' ) && $this->_config->get_boolean( 'dbcache.debug' ) ); 
  571. $debug = $debug || ( $this->_config->get_boolean( 'objectcache.enabled' ) && $this->_config->get_boolean( 'objectcache.debug' ) ); 
  572. $debug = $debug || ( $this->_config->get_boolean( 'browsercache.enabled' ) && $this->_config->get_boolean( 'browsercache.debug' ) ); 
  573. $debug = $debug || ( $this->_config->get_boolean( 'minify.enabled' ) && $this->_config->get_boolean( 'minify.debug' ) ); 
  574. $debug = $debug || ( $this->_config->get_boolean( 'cdn.enabled' ) && $this->_config->get_boolean( 'cdn.debug' ) ); 
  575.  
  576. return $debug; 
  577.  
  578. public function pro_dev_mode() { 
  579. echo '<!-- W3 Total Cache is currently running in Pro version Development mode. --><div style="border:2px solid red;text-align:center;font-size:1.2em;color:red"><p><strong>W3 Total Cache is currently running in Pro version Development mode.</strong></p></div>';