| @@ -27,9 +27,9 @@ | ||
| 27 | 27 | * @since 1.0.0 |
| 28 | 28 | * @since 2.0.0 Added the "modules" option. |
| 29 | 29 | * @var array<string, mixed> |
| 30 | 30 | */ |
| 31 | - protected $default_plugin_options = array( | |
| 31 | + protected array $default_plugin_options = array( | |
| 32 | 32 | 'plugin_options_db_version' => 0, |
| 33 | 33 | 'table_scheme_db_version' => 0, |
| 34 | 34 | 'prev_tablepress_version' => '0', |
| 35 | 35 | 'tablepress_version' => TablePress::version, |
| @@ -47,16 +47,17 @@ | ||
| 47 | 47 | /** |
| 48 | 48 | * Default User Options. |
| 49 | 49 | * |
| 50 | 50 | * @since 1.0.0 |
| 51 | - * @var array<string, mixed>> | |
| 51 | + * @var array<string, mixed> | |
| 52 | 52 | */ |
| 53 | - protected $default_user_options = array( | |
| 54 | - 'user_options_db_version' => TablePress::db_version, // To prevent saving on first load. | |
| 55 | - 'admin_menu_parent_page' => 'middle', | |
| 56 | - 'message_first_visit' => true, | |
| 57 | - 'table_editor_column_width' => '170', // Default column width of 170px of the table editor on the "Edit" screen. | |
| 58 | - 'table_editor_line_clamp' => '5', // Maximum number of lines per cell in the table editor on the "Edit" screen. | |
| 53 | + protected array $default_user_options = array( | |
| 54 | + 'user_options_db_version' => TablePress::db_version, // To prevent saving on first load. | |
| 55 | + 'admin_menu_parent_page' => 'middle', | |
| 56 | + 'message_first_visit' => true, | |
| 57 | + 'message_superseded_extensions' => true, | |
| 58 | + 'table_editor_column_width' => '170', // Default column width of 170px of the table editor on the "Edit" screen. | |
| 59 | + 'table_editor_line_clamp' => '5', // Maximum number of lines per cell in the table editor on the "Edit" screen. | |
| 59 | 60 | ); |
| 60 | 61 | |
| 61 | 62 | /** |
| 62 | 63 | * Instance of WP_Option class for Plugin Options. |
| @@ -61,19 +62,17 @@ | ||
| 61 | 62 | /** |
| 62 | 63 | * Instance of WP_Option class for Plugin Options. |
| 63 | 64 | * |
| 64 | 65 | * @since 1.0.0 |
| 65 | - * @var TablePress_WP_Option | |
| 66 | 66 | */ |
| 67 | - protected $plugin_options; | |
| 67 | + protected \TablePress_WP_Option $plugin_options; | |
| 68 | 68 | |
| 69 | 69 | /** |
| 70 | 70 | * Instance of WP_User_Option class for User Options. |
| 71 | 71 | * |
| 72 | 72 | * @since 1.0.0 |
| 73 | - * @var TablePress_WP_User_Option | |
| 74 | 73 | */ |
| 75 | - protected $user_options; | |
| 74 | + protected \TablePress_WP_User_Option $user_options; | |
| 76 | 75 | |
| 77 | 76 | /** |
| 78 | 77 | * Init Options Model by creating the object instances for the Plugin and User Options. |
| 79 | 78 | * |
| @@ -325,9 +324,9 @@ | ||
| 325 | 324 | public function map_tablepress_meta_caps( array $caps, /* string */ $cap, int $user_id, array $args ): array { |
| 326 | 325 | // Don't use a type hint for the `$cap` argument as many WordPress plugins seem to be passing `null` to capability check or admin menu functions. |
| 327 | 326 | |
| 328 | 327 | // Protect against other plugins not supplying a string for the `$cap` argument. |
| 329 | - if ( ! is_string( $cap ) ) { | |
| 328 | + if ( ! is_string( $cap ) ) { // @phpstan-ignore function.alreadyNarrowedType (The `is_string()` check is needed as the input is coming from a filter hook.) | |
| 330 | 329 | return $caps; |
| 331 | 330 | } |
| 332 | 331 | |
| 333 | 332 | if ( ! in_array( $cap, array( 'tablepress_edit_table', 'tablepress_edit_table_id', 'tablepress_copy_table', 'tablepress_delete_table', 'tablepress_export_table', 'tablepress_preview_table' ), true ) ) { |