Skip to content

Commit

Permalink
Finish TablePress 2.2.2.
Browse files Browse the repository at this point in the history
  • Loading branch information
TobiasBg committed Nov 6, 2023
1 parent fbe75c5 commit 71fbbab
Show file tree
Hide file tree
Showing 13 changed files with 74 additions and 25 deletions.
19 changes: 19 additions & 0 deletions .typos.toml
@@ -0,0 +1,19 @@
# Configuration and exclusion file for the "typos" tool (https://github.com/crate-ci/typos)

[files]
extend-exclude = [
"/admin/js/build/",
"/admin/js/jspreadsheet.js",
"/admin/js/jsuites.js",
"/i18n/",
"/js/*.min.js",
"/libraries/freemius/",
"/libraries/vendor/",
"/libraries/simplexlsx.class.php",
"/modules/i18n/",
"/modules/admin/js/build/",
"/modules/js/*.min.js",
]

[default.extend-words]
BA = "BA"
2 changes: 1 addition & 1 deletion blocks/table/block.json
Expand Up @@ -2,7 +2,7 @@
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 3,
"name": "tablepress/table",
"version": "2.2.1",
"version": "2.2.2",
"title": "TablePress table",
"category": "media",
"icon": "list-view",
Expand Down
4 changes: 2 additions & 2 deletions classes/class-tablepress.php
Expand Up @@ -27,7 +27,7 @@ abstract class TablePress {
* @since 1.0.0
* @const string
*/
public const version = '2.2.1'; // phpcs:ignore Generic.NamingConventions.UpperCaseConstantName.ClassConstantNotUpperCase
public const version = '2.2.2'; // phpcs:ignore Generic.NamingConventions.UpperCaseConstantName.ClassConstantNotUpperCase

/**
* TablePress internal plugin version ("options scheme" version).
Expand All @@ -37,7 +37,7 @@ abstract class TablePress {
* @since 1.0.0
* @const int
*/
public const db_version = 67; // phpcs:ignore Generic.NamingConventions.UpperCaseConstantName.ClassConstantNotUpperCase
public const db_version = 68; // phpcs:ignore Generic.NamingConventions.UpperCaseConstantName.ClassConstantNotUpperCase

/**
* TablePress "table scheme" (data format structure) version.
Expand Down
6 changes: 4 additions & 2 deletions composer.json
Expand Up @@ -70,12 +70,14 @@
"phpcs:full": "vendor/bin/phpcs",
"fix-phpcs": "vendor/bin/phpcbf --report=summary,source",
"php-parallel-lint": "vendor/bin/parallel-lint --exclude .git --exclude node_modules --exclude vendor --show-deprecated .",
"phpstan": "./vendor/bin/phpstan analyze --memory-limit 1G",
"phpstan": "vendor/bin/phpstan analyze --memory-limit 1G",
"typos": "typos",
"build": [
"@compat",
"@phpcs:full",
"@phpstan",
"@php-parallel-lint"
"@php-parallel-lint",
"@typos"
],
"spaces-to-tabs": "find . -type f -not -path './node_modules/*' -not -path './vendor/*' \\( -name \\*.php -o -name \\*.js -o -name \\*.scss -o -name \\*.css \\) -exec bash -c 'perl -pi -e \"s/(^|\\G) {4}/\t/g\" \"$0\"' {} \\;",
"update-phpspreadsheet": [
Expand Down
19 changes: 13 additions & 6 deletions controllers/controller-frontend.php
Expand Up @@ -574,14 +574,21 @@ public function shortcode_table( /* array|string */ $shortcode_atts ): string {
// Determine options to use (if set in Shortcode, use those, otherwise use stored options, from the "Edit" screen).
$render_options = array();
foreach ( $shortcode_atts as $key => $value ) {
// We have to check this, because strings 'true' or 'false' are not recognized as boolean!
if ( is_string( $value ) && 'true' === strtolower( $value ) ) {
$render_options[ $key ] = true;
} elseif ( is_string( $value ) && 'false' === strtolower( $value ) ) {
$render_options[ $key ] = false;
} elseif ( is_null( $value ) && isset( $table['options'][ $key ] ) ) {
if ( is_null( $value ) && isset( $table['options'][ $key ] ) ) {
// Use the table's stored option value, if the Shortcode parameter was not set.
$render_options[ $key ] = $table['options'][ $key ];
} elseif ( is_string( $value ) ) {
// Convert strings 'true' or 'false' to boolean, keep others.
$value_lowercase = strtolower( $value );
if ( 'true' === $value_lowercase ) {
$render_options[ $key ] = true;
} elseif ( 'false' === $value_lowercase ) {
$render_options[ $key ] = false;
} else {
$render_options[ $key ] = $value;
}
} else {
// Keep all other values.
$render_options[ $key ] = $value;
}
}
Expand Down
4 changes: 2 additions & 2 deletions js/jquery.datatables.min.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions libraries/csstidy/class.csstidy.php
Expand Up @@ -316,8 +316,8 @@ public function __construct() {
$this->settings['case_properties'] = 1;

/*
* Sort properties in alpabetic order, better for later gzipping,
* but can cause trouble in case of overiding same properties or using hacks.
* Sort properties in alphabetic order, better for later gzipping,
* but can cause trouble in case of overriding same properties or using hacks.
*/
$this->settings['sort_properties'] = false;

Expand Down Expand Up @@ -989,7 +989,7 @@ public function parse( string $a_string ): bool {
}

/**
* Quoting: format() in font-face needs quoted values for somes browser (FF at least).
* Quoting: format() in font-face needs quoted values for some browser (FF at least).
*
* @since 1.0.0
*
Expand Down
9 changes: 8 additions & 1 deletion models/model-options.php
Expand Up @@ -298,7 +298,14 @@ public function remove_access_capabilities(): void {
* @param mixed[] $args Arguments for the check, here e.g. the table ID.
* @return string[] Modified set of primitive caps.
*/
public function map_tablepress_meta_caps( array $caps, string $cap, int $user_id, array $args ): array {
public function map_tablepress_meta_caps( array $caps, /* string */ $cap, int $user_id, array $args ): array {
// 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.

// Protect against other plugins not supplying a string for the `$cap` argument.
if ( ! is_string( $cap ) ) {
return $caps;
}

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 ) ) {
return $caps;
}
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "@tablepress/tablepress",
"version": "2.2.1",
"version": "2.2.2",
"description": "Embed beautiful and feature-rich tables into your posts and pages, without having to write code.",
"author": "Tobias Bäthge",
"license": "GPL-2.0-only",
Expand Down
11 changes: 9 additions & 2 deletions readme.txt
Expand Up @@ -5,7 +5,7 @@ Tags: table,spreadsheet,data,csv,excel,html,tables
Requires at least: 6.0
Requires PHP: 7.2
Tested up to: 6.4
Stable tag: 2.2.1
Stable tag: 2.2.2
License: GPLv2
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Expand Down Expand Up @@ -106,6 +106,13 @@ You may also add certain features (like sorting, pagination, filtering, alternat

Changes in recent versions are shown below. For earlier changes, please see the [changelog history](https://tablepress.org/info/#changelog).

= Version 2.2.2 =

* Further protection against bugs in other plugins that interfere with the loading of JavaScript files, causing the TablePress admin screens to be unusable, was added.
* The code that evaluates Shortcode parameters was optimized for a higher performance.
* The “Sorted” order of the “Row Order” premium feature module no longer raises an error. (TablePress Pro and Max only.)
* Updated external libraries to benefit from enhancements and bug fixes.

= Version 2.2.1 =

* Further protection against bugs in other plugins that interfere with the loading of JavaScript files, causing the TablePress admin screens to be unusable, was added.
Expand Down Expand Up @@ -149,5 +156,5 @@ Changes in recent versions are shown below. For earlier changes, please see the

== Upgrade Notice ==

= 2.2.1 =
= 2.2.2 =
This update is a feature, stability, maintenance, and compatibility release. Updating is highly recommended.
4 changes: 2 additions & 2 deletions tablepress.php
Expand Up @@ -4,13 +4,13 @@
*
* @package TablePress
* @author Tobias Bäthge
* @version 2.2.1
* @version 2.2.2
*
*
* Plugin Name: TablePress
* Plugin URI: https://tablepress.org/
* Description: Embed beautiful and interactive tables into your WordPress website’s posts and pages, without having to write code!
* Version: 2.2.1
* Version: 2.2.2
* Requires at least: 6.0
* Requires PHP: 7.2
* Author: Tobias Bäthge
Expand Down
9 changes: 8 additions & 1 deletion views/view-edit.php
Expand Up @@ -108,7 +108,14 @@ public function change_media_view_strings( array $strings ): array {
* @param WP_Screen $screen WP_Screen object.
* @return string Extended Screen settings.
*/
public function add_screen_options_output( string $screen_settings, WP_Screen $screen ): string {
public function add_screen_options_output( /* string */ $screen_settings, WP_Screen $screen ): string {
// Don't use a type hint for the `$screen_settings` argument as many WordPress plugins seem to be returning `null` in their filter hook handlers.

// Protect against other plugins not returning a string for the `$screen_settings` argument.
if ( ! is_string( $screen_settings ) ) {
$screen_settings = '';
}

$screen_settings = '<fieldset id="tablepress-screen-options" class="screen-options">';
$screen_settings .= '<legend>' . __( 'Table editor settings', 'tablepress' ) . '</legend>';
$screen_settings .= '<p>' . __( 'Adjust the default size of the table cells in the table editor below.', 'tablepress' ) . ' ' . __( 'Cells with many lines of text will expand to their full height when they are edited.', 'tablepress' ) . '</p>';
Expand Down

0 comments on commit 71fbbab

Please sign in to comment.