芝麻web文件管理V1.00
编辑当前文件:/var/www/cognitio.in/wp-content/plugins/popup-maker/classes/Admin/Tools.php
$_GET['success'] ? 'success' : 'error', 'message' => get_option( 'pum_settings_admin_notice' ), ]; delete_option( 'pum_settings_admin_notice' ); } if ( ! empty( self::$notices ) ) { foreach ( self::$notices as $notice ) { ?>
$tab_name ) { $tab_url = add_query_arg( [ 'tools-updated' => false, 'tab' => $tab_id, ] ); printf( '
%s
', esc_url( $tab_url ), esc_attr( $tab_name ), $active_tab === $tab_id ? ' nav-tab-active' : '', esc_html( $tab_name ) ); } ?>
__( 'Beta Versions', 'popup-maker' ), 'error_log' => __( 'Error Log', 'popup-maker' ), 'import' => __( 'Import / Export', 'popup-maker' ), ] ); /** @deprecated 1.7.0 */ $tabs = apply_filters( 'popmake_tools_tabs', $tabs ); } return $tabs; } /** * Return an array of all extensions with beta support * * Extensions should be added as 'extension-slug' => 'Extension Name' * * @return array $extensions The array of extensions * @since 1.5 */ public static function get_beta_enabled_extensions() { return apply_filters( 'pum_beta_enabled_extensions', [] ); } /** * @return int|null|string */ public static function get_active_tab() { $tabs = self::tabs(); return isset( $_GET['tab'] ) && array_key_exists( $_GET['tab'], $tabs ) ? sanitize_text_field( $_GET['tab'] ) : key( $tabs ); } /** * Display beta opt-ins * * @since 1.3 */ public static function betas_display() { if ( ! current_user_can( 'manage_options' ) ) { return; } $has_beta = self::get_beta_enabled_extensions(); do_action( 'pum_tools_betas_before' ); ?>
$product ) : ?>
value="1" />
Error Log
Download Error Log
render_admin_ui(); } } /** * Displays the contents for the Import tab * * @since 1.12.0 */ public static function import_display() { ?>
Using Easy Modal?
Click this button to import popups from the Easy Modal plugin.
clear_log(); } /** * Process em import. */ public static function emodal_process_import() { if ( ! isset( $_REQUEST['popmake_emodal_v2_import'] ) ) { return; } popmake_emodal_v2_import(); wp_safe_redirect( admin_url( 'edit.php?post_type=popup&page=pum-tools&imported=1' ), 302 ); } /** * Save enabled betas * * @since 1.5 */ public static function save_enabled_betas() { if ( ! wp_verify_nonce( $_POST['pum_save_betas_nonce'], 'pum_save_betas_nonce' ) ) { return; } if ( ! current_user_can( 'manage_options' ) ) { return; } if ( ! empty( $_POST['enabled_betas'] ) ) { $enabled_betas = array_filter( array_map( [ __CLASS__, 'enabled_betas_sanitize_value', ], $_POST['enabled_betas'] ) ); PUM_Utils_Options::update( 'enabled_betas', $enabled_betas ); } else { PUM_Utils_Options::delete( 'enabled_betas' ); } } /** * Sanitize the supported beta values by making them booleans * * @param mixed $value The value being sent in, determining if beta support is enabled. * * @return bool * @since 1.5 */ public static function enabled_betas_sanitize_value( $value ) { return filter_var( $value, FILTER_VALIDATE_BOOLEAN ); } /** * Check if a given extensions has beta support enabled * * @param string $slug The slug of the extension to check. * * @return bool True if enabled, false otherwise * @since 1.5 */ public static function extension_has_beta_support( $slug ) { $enabled_betas = PUM_Utils_Options::get( 'enabled_betas', [] ); $return = false; if ( array_key_exists( $slug, $enabled_betas ) ) { $return = true; } return $return; } /** * Retrieves error log and prepares it for displaying * * @uses PUM_Utils_Logging::get_log() * @since 1.12.0 */ public static function display_error_log() { $logger = PUM_Utils_Logging::instance(); if ( ! $logger->enabled() ) { return __( 'Debug logging is disabled.', 'popup-maker' ); } $logger->log( 'Log viewed from Tools page' ); return $logger->get_log(); } }