' . $label . ''; } /** * Render a button with a full URL (already absolute). */ function qmen_button_url( $label, $url, $class = 'button' ) { $href = esc_url( $url ); $label = esc_html( $label ); $class = esc_attr( $class . ' qmen-button' ); echo '' . $label . ''; } /** * Log discovered plugins to error_log for diagnosis. */ function qmen_log_plugins_state() { // Only log when in admin to reduce noise. if ( ! is_admin() ) { return; } if ( ! function_exists( 'get_plugins' ) ) { @require_once ABSPATH . 'wp-admin/includes/plugin.php'; } $plugins = function_exists( 'get_plugins' ) ? get_plugins() : array(); $active_plugins = (array) get_option( 'active_plugins', array() ); $lines = array(); foreach ( $plugins as $file => $data ) { $name = isset( $data['Name'] ) ? $data['Name'] : $file; $active = in_array( $file, $active_plugins, true ) || ( function_exists( 'is_plugin_active' ) && is_plugin_active( $file ) ); $lines[] = sprintf( '%s | %s | %s', $file, $name, $active ? 'active' : 'inactive' ); } $summary = sprintf( 'AdminFly debug: get_plugins() count=%d; items=[%s]', count( $plugins ), implode( '; ', $lines ) ); error_log( $summary ); // Also log MU-plugins count for visibility. if ( function_exists( 'get_mu_plugins' ) ) { $mu = get_mu_plugins(); error_log( sprintf( 'AdminFly debug: get_mu_plugins() count=%d', is_array( $mu ) ? count( $mu ) : 0 ) ); } } /** * Get inline CSS styles for the AdminFly page. */ function qmen_inline_styles() { return '/* AdminFly styles */ .qmen-wrap { max-width: 900px; } .qmen-section { margin: 24px 0; } .qmen-section h2 { margin: 0 0 12px; } .qmen-tree { list-style: none; margin: 0; padding: 0 0 0 14px; position: relative; } .qmen-tree .qmen-node { margin: 6px 0; position: relative; } .qmen-children { list-style: none; margin: 6px 0 6px 18px; padding-left: 16px; border-left: 1px dashed #c3c4c7; } .qmen-actions { margin: 8px 0 0; display: flex; flex-wrap: wrap; gap: 8px; } .qmen-button { text-decoration: none; } .qmen-badge { display: inline-block; margin-left: 6px; padding: 1px 6px; font-size: 11px; background: #eef6ff; color: #1d4ed8; border: 1px solid #bfdbfe; border-radius: 12px; vertical-align: middle; } .qmen-note { color: #646970; font-size: 12px; margin-top: 2px; } .qmen-card { background: #fff; border: 1px solid #dcdcde; border-radius: 6px; padding: 16px; } .qmen-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; } .qmen-status { display:inline-flex; align-items:center; gap:6px; } .qmen-status-dot { width:10px; height:10px; border-radius:50%; display:inline-block; } .qmen-status-dot.active { background:#22c55e; border:1px solid #16a34a; } .qmen-status-dot.inactive { background:#ef4444; border:1px solid #b91c1c; } .qmen-item { margin:8px 0; } .qmen-settings ul { list-style: none; padding-left: 0; } .qmen-settings li { margin: 8px 0; } .qmen-muted { color:#646970; } '; }