upgrade
3 days ago
widgets
3 days ago
components-admin.php
3 days ago
field-option.php
3 days ago
form-settings.php
3 days ago
form.php
3 days ago
help.php
3 days ago
postbox-header.php
3 days ago
settings-reset.php
3 days ago
settings-settings.php
3 days ago
settings-tools.php
3 days ago
settings.php
3 days ago
setup-add.php
3 days ago
setup-edit-field-fluid.php
3 days ago
setup-edit-field.php
3 days ago
setup-edit.php
3 days ago
shortcode.php
3 days ago
view.php
3 days ago
settings-tools.php
106 lines
| 1 | <?php |
| 2 | if ( ! empty( $_POST ) ) { |
| 3 | if ( isset( $_POST['clearcache'] ) ) { |
| 4 | $api = pods_api(); |
| 5 | |
| 6 | $api->cache_flush_pods(); |
| 7 | |
| 8 | if ( defined( 'PODS_PRELOAD_CONFIG_AFTER_FLUSH' ) && PODS_PRELOAD_CONFIG_AFTER_FLUSH ) { |
| 9 | $api->load_pods( array( 'bypass_cache' => true ) ); |
| 10 | } |
| 11 | |
| 12 | pods_redirect( pods_query_arg( array( 'pods_clearcache' => 1 ), array( 'page', 'tab' ) ) ); |
| 13 | } |
| 14 | } elseif ( 1 == pods_v_sanitized( 'pods_clearcache' ) ) { |
| 15 | pods_message( 'Pods transients and cache have been cleared.' ); |
| 16 | } |
| 17 | ?> |
| 18 | |
| 19 | <h3><?php _e( 'Clear Pods Cache', 'pods' ); ?></h3> |
| 20 | |
| 21 | <p><?php esc_html_e( 'This tool will clear all of the transients/cache that are used by Pods.', 'pods' ); ?></p> |
| 22 | |
| 23 | <p class="submit"> |
| 24 | <input type="submit" class="button button-primary" name="clearcache" value="<?php esc_attr_e( 'Clear Pods Cache', 'pods' ); ?>" /> |
| 25 | </p> |
| 26 | |
| 27 | <hr /> |
| 28 | |
| 29 | <h3><?php _e( 'Debug Information', 'pods' ); ?></h3> |
| 30 | |
| 31 | <?php |
| 32 | global $wp_version, $wpdb; |
| 33 | |
| 34 | $wp = $wp_version; |
| 35 | $php = phpversion(); |
| 36 | $mysql = $wpdb->db_version(); |
| 37 | $plugins = array(); |
| 38 | |
| 39 | $all_plugins = get_plugins(); |
| 40 | |
| 41 | foreach ( $all_plugins as $plugin_file => $plugin_data ) { |
| 42 | if ( is_plugin_active( $plugin_file ) ) { |
| 43 | $plugins[ $plugin_data['Name'] ] = $plugin_data['Version']; |
| 44 | } |
| 45 | } |
| 46 | |
| 47 | $stylesheet = get_stylesheet(); |
| 48 | $theme = wp_get_theme( $stylesheet ); |
| 49 | $theme_name = $theme->get( 'Name' ); |
| 50 | |
| 51 | $opcode_cache = array( |
| 52 | 'Apc' => function_exists( 'apc_cache_info' ) ? 'Yes' : 'No', |
| 53 | 'Memcached' => class_exists( 'eaccelerator_put' ) ? 'Yes' : 'No', |
| 54 | 'OPcache' => function_exists( 'opcache_get_status' ) ? 'Yes' : 'No', |
| 55 | 'Redis' => class_exists( 'xcache_set' ) ? 'Yes' : 'No', |
| 56 | ); |
| 57 | |
| 58 | $object_cache = array( |
| 59 | 'APC' => function_exists( 'apc_cache_info' ) ? 'Yes' : 'No', |
| 60 | 'APCu' => function_exists( 'apcu_cache_info' ) ? 'Yes' : 'No', |
| 61 | 'Memcache' => class_exists( 'Memcache' ) ? 'Yes' : 'No', |
| 62 | 'Memcached' => class_exists( 'Memcached' ) ? 'Yes' : 'No', |
| 63 | 'Redis' => class_exists( 'Redis' ) ? 'Yes' : 'No', |
| 64 | ); |
| 65 | |
| 66 | $versions = array( |
| 67 | 'WordPress Version' => $wp, |
| 68 | 'PHP Version' => $php, |
| 69 | 'MySQL Version' => $mysql, |
| 70 | 'Server Software' => $_SERVER['SERVER_SOFTWARE'], |
| 71 | 'Your User Agent' => $_SERVER['HTTP_USER_AGENT'], |
| 72 | 'Session Save Path' => session_save_path(), |
| 73 | 'Session Save Path Exists' => ( file_exists( session_save_path() ) ? 'Yes' : 'No' ), |
| 74 | 'Session Save Path Writeable' => ( is_writable( session_save_path() ) ? 'Yes' : 'No' ), |
| 75 | 'Session Max Lifetime' => ini_get( 'session.gc_maxlifetime' ), |
| 76 | 'Opcode Cache' => $opcode_cache, |
| 77 | 'Object Cache' => $object_cache, |
| 78 | 'WPDB Prefix' => $wpdb->prefix, |
| 79 | 'WP Multisite Mode' => ( is_multisite() ? 'Yes' : 'No' ), |
| 80 | 'WP Memory Limit' => WP_MEMORY_LIMIT, |
| 81 | 'Current Memory Usage' => number_format_i18n( memory_get_usage() / 1024 / 1024, 3 ) . 'M', |
| 82 | 'Current Memory Usage (real)' => number_format_i18n( memory_get_usage( true ) / 1024 / 1024, 3 ) . 'M', |
| 83 | 'Pods Network-Wide Activated' => ( is_plugin_active_for_network( basename( PODS_DIR ) . '/init.php' ) ? 'Yes' : 'No' ), |
| 84 | 'Pods Install Location' => PODS_DIR, |
| 85 | 'Pods Tableless Mode Activated' => ( ( pods_tableless() ) ? 'Yes' : 'No' ), |
| 86 | 'Pods Light Mode Activated' => ( ( pods_light() ) ? 'Yes' : 'No' ), |
| 87 | 'Currently Active Theme' => $theme_name, |
| 88 | 'Currently Active Plugins' => $plugins, |
| 89 | ); |
| 90 | |
| 91 | foreach ( $versions as $what => $version ) { |
| 92 | echo '<p><strong>' . esc_html( $what ) . '</strong>: '; |
| 93 | |
| 94 | if ( is_array( $version ) ) { |
| 95 | echo '</p><ul class="ul-disc">'; |
| 96 | |
| 97 | foreach ( $version as $what_v => $v ) { |
| 98 | echo '<li><strong>' . esc_html( $what_v ) . '</strong>: ' . esc_html( $v ) . '</li>'; |
| 99 | } |
| 100 | |
| 101 | echo '</ul>'; |
| 102 | } else { |
| 103 | echo esc_html( $version ) . '</p>'; |
| 104 | } |
| 105 | } |
| 106 |