Tools_Page
Tools page class.
Namespace: WebberZone\Contextual_Related_Posts\Admin
Source: includes/admin/class-tools-page.php line 25
Methods
__construct()
Constructor.
Line: 41
public function __construct( );
admin_menu()
Admin Menu.
Since: 3.5.0
Line: 55
public function admin_menu( );
render_page() static
Render the tools settings page.
Since: 3.5.0
Line: 73
static public function render_page( ): void;
Returns: void
get_status_rows() static
Get the rows shown in the Status box on the Tools page.
Each row is an array with a ‘label’ (plain text) and a ‘value’ (HTML, already escaped).
Since: 4.5.0
Line: 291
static public function get_status_rows( $network_wide = ... ): array;
| Type | Name | Description |
|---|---|---|
bool |
$network_wide |
Whether the report is rendered on the Network Admin Tools page. |
Returns: array — Array of status rows keyed by row ID.
get_status_report() static
Get the Status report shown on the Tools page.
Since: 4.5.0
Line: 399
static public function get_status_report( $network_wide = ... ): string;
| Type | Name | Description |
|---|---|---|
bool |
$network_wide |
Whether the report is rendered on the Network Admin Tools page. |
Returns: string — HTML output for the status report.
status_label() static
Wrap a status value in a coloured label.
Since: 4.5.0
Line: 433
static public function status_label( $ok, $ok_text, $bad_text = ..., $is_neutral = ... ): string;
| Type | Name | Description |
|---|---|---|
bool |
$ok |
Whether the status is good. |
string |
$ok_text |
Text to show when the status is good. |
string |
$bad_text |
Optional. Text to show when the status is not good. Defaults to $ok_text. |
bool |
$is_neutral |
Optional. Show the bad state in the default colour rather than red, e.g. for a disabled option. |
Returns: string — Escaped HTML.
get_database_server_info() static
Get the database server type and version.
Since: 4.5.0
Line: 452
static public function get_database_server_info( ): string;
Returns: string — Database server description, e.g. “MySQL 8.0.36” or “MariaDB 10.11.6”.
get_table_stats() static
Get the storage engine, estimated rows and size of a database table.
Since: 4.5.0
Line: 475
static public function get_table_stats( $table_name ): array|false;
| Type | Name | Description |
|---|---|---|
string |
$table_name |
Full table name including prefix. |
Returns: array|false — Array with ‘engine’, ‘entries’ and ‘size’ keys, or false if the table was not found.
get_table_stats_html() static
Format table statistics for the Status box.
Since: 4.5.0
Line: 503
static public function get_table_stats_html( $stats ): string;
| Type | Name | Description |
|---|---|---|
array|false |
$stats |
Table statistics from get_table_stats(). |
Returns: string — Escaped HTML.
recreate_indices_sql() static
Retrieves the SQL code to recreate the fulltext indexes.
Since: 3.5.0
Line: 565
static public function recreate_indices_sql( );
process_settings_export() static
Process a settings export that generates a .json file of the shop settings
Since: 2.9.0
Line: 614
static public function process_settings_export( );
process_settings_import() static
Process a settings import from a json file
Since: 2.9.0
Line: 646
static public function process_settings_import( );
admin_enqueue_scripts()
Enqueue scripts and styles.
Since: 3.5.0
Line: 699
public function admin_enqueue_scripts( $hook );
| Type | Name | Description |
|---|---|---|
string |
$hook |
The current screen hook. |
get_migration_count() static
Get the number of posts that need migration.
Since: 4.2.0
Line: 751
static public function get_migration_count( ): int;
Returns: int — Number of posts with crp_post_meta.
get_undo_count() static
Get the number of posts that can be undone.
Since: 4.2.0
Line: 763
static public function get_undo_count( ): int;
Returns: int — Number of distinct post_ids with crp keys excluding cache.
migrate_meta_batch() static
Migrate meta data from crp_post_meta array to individual crp* keys.
Since: 4.2.0
Line: 775
static public function migrate_meta_batch( );
undo_migrate_meta_batch() static
Undo migrate meta data from individual crp* keys back to crp_post_meta array.
Since: 4.2.0
Line: 809
static public function undo_migrate_meta_batch( );
rollback_meta_batch() static
Rollback meta data from individual crp* keys back to crp_post_meta array.
Since: 4.2.0
Line: 893
static public function rollback_meta_batch( );