'data-tables-overview', 'title' => __( 'Coverage', 'ai-eshop-optimizer' ) ) ); echo $aieo_dt_open; $aieo_dt_failed = \Rooster\Admin\States::state( 'failed', array( 'title' => __( 'The table registry is not loaded.', 'ai-eshop-optimizer' ), 'compact' => true ) ); echo $aieo_dt_failed; echo $aieo_dt_close; return; } $aieo_dt_rows = isset( $rows ) ? (array) $rows : array(); $aieo_dt_counts = isset( $counts ) ? (array) $counts : array(); $aieo_dt_problems = isset( $problems ) ? (array) $problems : array(); $aieo_dt_defaults = isset( $defaults ) ? (array) $defaults : array(); ?> $kind ) ); }; rooster_admin_band_open( array( 'cols' => 1 ) ); list( $aieo_dt_open, $aieo_dt_close ) = AIEO_DMM_UI::card( array( 'anchor' => 'data-tables-overview', 'title' => __( 'Coverage', 'ai-eshop-optimizer' ), 'description' => __( 'Every data table in the product, what it is made of, and which features it offers. A table declares what it wants rather than the component guessing from its size, which is what lets one library serve a twelve-row status list and a report of several million rows without either being compromised.', 'ai-eshop-optimizer' ), ) ); echo $aieo_dt_open; ?>
__( 'How complete is this list?', 'ai-eshop-optimizer' ) ) ); echo $aieo_dt_note_1; $aieo_dt_note_2 = \Rooster\Admin\Guidance::text( __( 'All 22 insights reports are now listed, with their real row counts, the table each one reads and whether that data could ever be served remotely. None of them is on the new contract yet: they still render through the third-party plugin, and the defect chips say what that costs. They are the largest and slowest tables in the product, so they are the ones worth converting first.', 'ai-eshop-optimizer' ), 'guidance', array( 'question' => __( 'And the insights reports?', 'ai-eshop-optimizer' ) ) ); echo $aieo_dt_note_2; ?> 'data-tables-storefront', 'icon' => 'app-window', 'title' => __( 'Storefront tables', 'ai-eshop-optimizer' ), 'description' => __( 'A table can also face the shop. The Fast Finder is one: it is placed on a page as the "Rooster One Data Table" block, in the block editor like any other block, and it reads the same product vitals table the admin reports read. Which columns it shows, which of them are filters, and whether a filter is also a column are declared in the table\'s definition in code; its paging, search and filter capabilities are the row it has in the registry below. A table is public only when it is on the short list in the code that serves the storefront, and that list is not a setting: adding a table to it is a review, because everything on it is readable without logging in.', 'ai-eshop-optimizer' ), ) ); echo $aieo_dt_open; ?> 'aieo-section-data-tables-columns-and-filters', 'description' => __( 'Per table: which columns are shown in the grid and which have a filter dropdown. The two are independent, so a column can filter without taking up space in the grid. A change applies to the next render of the page, and one that would break the table is refused and says why. A column that only presents a value, such as an image or a link, cannot be a filter.', 'ai-eshop-optimizer' ), ) ); ?> $aieo_dt_cg ) : ?>
>

'data-tables-problems', 'flush' => true, 'icon' => 'file-question-mark', 'title' => __( 'Registry problems', 'ai-eshop-optimizer' ), 'description' => __( 'Rows whose declaration does not hold up on this install. A page that no module registered is usually not a mistake: report pages are registered from an option and Pro screens do not exist on a free install, so a row can be correct here and absent there.', 'ai-eshop-optimizer' ), ) ); echo $aieo_dt_open; $aieo_dt_problem_rows = array(); foreach ( $aieo_dt_problems as $aieo_dt_id => $aieo_dt_list ) { $aieo_dt_problem_rows[] = array( 'id' => $aieo_dt_id, 'problem' => implode( ' ', (array) $aieo_dt_list ), ); } AIEO_Table::render( array( 'caption' => __( 'Registry problems', 'ai-eshop-optimizer' ), 'id' => 'aieo-dt-problems', 'row_key' => 'id', 'density' => 'compact', 'rows' => $aieo_dt_problem_rows, 'caps' => array( 'search' => true ), 'columns' => array( array( 'key' => 'id', 'label' => __( 'Table', 'ai-eshop-optimizer' ), 'type' => 'code' ), array( 'key' => 'problem', 'label' => __( 'Problem', 'ai-eshop-optimizer' ) ), ), 'empty' => __( 'Every registered table checks out on this install.', 'ai-eshop-optimizer' ), ) ); echo $aieo_dt_close; list( $aieo_dt_open, $aieo_dt_close ) = AIEO_DMM_UI::card( array( 'anchor' => 'data-tables-defaults', 'icon' => 'settings', 'title' => __( 'Site defaults', 'ai-eshop-optimizer' ), 'description' => __( 'Applies to every table that does not set its own. It is a default and never a cap: a table showing this many rows per page still pages through all of them.', 'ai-eshop-optimizer' ), ) ); echo $aieo_dt_open; ?> 'aieo-dt-per-page', 'type' => 'number', 'xs' => true, 'min' => AIEO_Table_Registry::PER_PAGE_MIN, 'max' => AIEO_Table_Registry::PER_PAGE_MAX, 'attrs' => \Rooster\Admin\States::save_attrs( $aieo_dt_save_url ) + array( 'data-aieo-dt-save' => 'defaults' ), ) ); $aieo_dt_per_page_row = \Rooster\Admin\Ui::field_row( array( 'id' => 'aieo-dt-per-page', 'label' => __( 'Rows per page', 'ai-eshop-optimizer' ), 'control' => $aieo_dt_per_page, 'help' => sprintf( __( 'Between %1$s and %2$s.', 'ai-eshop-optimizer' ), number_format_i18n( AIEO_Table_Registry::PER_PAGE_MIN ), number_format_i18n( AIEO_Table_Registry::PER_PAGE_MAX ) ), ) ); echo '
' . $aieo_dt_per_page_row . '
'; ?> 'data-tables-registered', 'icon' => 'table', 'title' => __( 'Registered data tables', 'ai-eshop-optimizer' ), 'description' => __( 'Kind, tier, scope and source are facts about the code and are not editable here. The capability columns are settings: turning paging on for a screen should be a setting rather than a code change. Hand-written screens read none of them, so their controls are unavailable.', 'ai-eshop-optimizer' ), 'flush' => true, ) ); echo $aieo_dt_open; echo AIEO_DMM_Data_Tables::table_html( $aieo_dt_rows ); echo $aieo_dt_close; list( $aieo_dt_open, $aieo_dt_close ) = AIEO_DMM_UI::card( array( 'anchor' => 'data-tables-permissions', 'icon' => 'user-lock', 'title' => __( 'Who can do what', 'ai-eshop-optimizer' ), 'description' => __( 'Four separate permissions, because they are four different risks.', 'ai-eshop-optimizer' ), ) ); echo $aieo_dt_open; echo \Rooster\Admin\Ui::notice( esc_html( __( 'Export is usually the strongest: somebody who can export has taken a copy that leaves with them and does not come back.', 'ai-eshop-optimizer' ) ), 'warning', array( 'inline' => true ) ); ?> __( 'Whose permissions are these?', 'ai-eshop-optimizer' ) ) ); echo $aieo_dt_note_4; echo '' . AIEO_DMM_Data_Tables::permissions_table_html( isset( $perms ) ? (array) $perms : array() ) . ''; $aieo_dt_roles_text = __( '%1$s and %2$s exist so somebody can be given exactly one of these without becoming a shop manager.', 'ai-eshop-optimizer' ); $aieo_dt_note_5 = \Rooster\Admin\Guidance::text( sprintf( $aieo_dt_roles_text, __( 'Rooster Data Exporter', 'ai-eshop-optimizer' ), __( 'Rooster Data Editor', 'ai-eshop-optimizer' ) ), 'guidance', array( 'html' => sprintf( esc_html( $aieo_dt_roles_text ), '' . esc_html__( 'Rooster Data Exporter', 'ai-eshop-optimizer' ) . '', '' . esc_html__( 'Rooster Data Editor', 'ai-eshop-optimizer' ) . '' ), 'question' => __( 'Why two roles?', 'ai-eshop-optimizer' ) ) ); echo $aieo_dt_note_5; ?>