PluginProbe
TablePress – Tables in WordPress made easy / 3.4
TablePress – Tables in WordPress made easy v3.4
3.4 3.3.4 3.3.3 3.3.2 3.3.1 trunk 1.12 1.14 1.9.2 2.0.4 2.1.7 2.1.8 2.2 2.2.1 2.2.2 2.2.3 2.2.4 2.2.5 2.3 2.3.1 2.3.2 2.4 2.4.1 2.4.2 2.4.3 All 45 releases
← All changes | views/view-about.php +49 -33 2.2.2 → 3.4 View file →
@@ -7,8 +7,10 @@
7 7 * @author Tobias Bäthge
8 8 * @since 1.0.0
9 9 */
10 10
11 +declare(strict_types=1);
12 +
11 13 // Prohibit direct script loading.
12 14 defined( 'ABSPATH' ) || die( 'No direct script access allowed!' );
13 15
14 16 /**
@@ -24,11 +26,10 @@
24 26 /**
25 27 * Number of screen columns for post boxes on this screen.
26 28 *
27 29 * @since 1.0.0
28 - * @var int
29 30 */
30 - protected $screen_columns = 2;
31 + protected int $screen_columns = 2;
31 32
32 33 /**
33 34 * Set up the view with data and do things that are specific for this view.
34 35 *
@@ -36,13 +37,16 @@
36 37 *
37 38 * @param string $action Action for this view.
38 39 * @param array<string, mixed> $data Data for this view.
39 40 */
41 + #[\Override]
40 42 public function setup( /* string */ $action, array $data ) /* : void */ {
41 43 // Don't use type hints in the method declaration to prevent PHP errors, as the method is inherited.
42 44
43 45 parent::setup( $action, $data );
44 46
47 + TablePress::enqueue_script( 'common', array( 'jquery-core', 'postbox' ) );
48 +
45 49 $this->add_text_box( 'spacer', array( $this, 'textbox_spacer' ), 'normal' );
46 50 $this->add_text_box( 'spacer', array( $this, 'textbox_spacer' ), 'side' );
47 51 $this->add_meta_box( 'plugin-purpose', __( 'Plugin Purpose', 'tablepress' ), array( $this, 'postbox_plugin_purpose' ), 'normal' );
48 52 $this->add_meta_box( 'usage', __( 'Usage', 'tablepress' ), array( $this, 'postbox_usage' ), 'normal' );
@@ -61,11 +65,9 @@
61 65 * @param array<string, mixed> $data Data for this screen.
62 66 * @param array<string, mixed> $box Information about the text box.
63 67 */
64 68 public function textbox_spacer( array $data, array $box ): void {
65 - ?>
66 - <p></p>
67 - <?php
69 + echo '<p></p>';
68 70 }
69 71
70 72 /**
71 73 * Print the content of the "Plugin Purpose" post meta box.
@@ -79,9 +81,9 @@
79 81 ?>
80 82 <p>
81 83 <?php _e( 'TablePress allows you to create and manage tables in the admin area of WordPress.', 'tablepress' ); ?>
82 84 <?php _e( 'Tables may contain text, numbers, formulas, and even HTML code (e.g. to include images or links).', 'tablepress' ); ?>
83 - <?php _e( 'You can embed the tables into posts, pages, or other site areas using a block in the block editor.', 'tablepress' ); ?>
85 + <?php _e( 'You can embed the tables into posts, pages, or other site areas using a block in the block editor, a widget in the Elementor page builder, or a Shortcode.', 'tablepress' ); ?>
84 86 </p>
85 87 <?php
86 88 }
87 89
@@ -106,10 +108,12 @@
106 108 </p>
107 109 <p>
108 110 <?php
109 111 // Show the instructions string depending on whether the Block Editor is used on the site or not.
110 - if ( $data['site_uses_block_editor'] ) {
112 + if ( 'block' === $data['site_used_editor'] ) {
111 113 printf( __( 'To insert a table into a post or page, add a “%1$s” block in the block editor and select the desired table.', 'tablepress' ), __( 'TablePress table', 'tablepress' ) );
114 + } elseif ( 'elementor' === $data['site_used_editor'] ) {
115 + printf( __( 'To insert a table into a post or page, add a “%1$s” widget in the Elementor editor and select the desired table.', 'tablepress' ), __( 'TablePress table', 'tablepress' ) );
112 116 } else {
113 117 _e( 'To insert a table into a post or page, paste its Shortcode at the desired place in the editor.', 'tablepress' );
114 118 echo ' ';
115 119 _e( 'Each table has a unique ID that needs to be adjusted in that Shortcode.', 'tablepress' );
@@ -153,16 +157,23 @@
153 157 */
154 158 public function postbox_author_license( array $data, array $box ): void {
155 159 ?>
156 160 <p>
157 - <?php printf( __( 'This plugin was written and developed by <a href="%s">Tobias Bäthge</a>.', 'tablepress' ), 'https://tobias.baethge.com/' ); ?>
161 + <?php
162 + /* translators: %s: Author's website URL */
163 + printf( __( 'This plugin was written and developed by <a href="%s">Tobias Bäthge</a>.', 'tablepress' ), 'https://tobias.baethge.com/' );
164 + ?>
158 165 <?php _e( 'It is licensed as Free Software under GNU General Public License 2 (GPL 2).', 'tablepress' ); ?>
159 166 </p>
160 167 <p>
161 - <?php printf( __( 'Please rate and review the plugin in the <a href="%s">WordPress Plugin Directory</a>.', 'tablepress' ), 'https://wordpress.org/support/view/plugin-reviews/tablepress' ); ?>
168 + <?php
169 + /* translators: %s: WordPress Plugin Directory URL */
170 + printf( __( 'Please rate and review the plugin in the <a href="%s">WordPress Plugin Directory</a>.', 'tablepress' ), 'https://wordpress.org/support/view/plugin-reviews/tablepress' );
171 + ?>
162 172 </p>
163 173 <?php
164 174 if ( tb_tp_fs()->is_free_plan() ) {
175 + /* translators: %s: TablePress Premium website URL */
165 176 echo '<p><strong>' . sprintf( __( 'I would like to invite you to check out the <a href="%s">Premium versions of TablePress</a>.', 'tablepress' ), 'https://tablepress.org/premium/?utm_source=plugin&utm_medium=textlink&utm_content=about-screen' ) . ' '
166 177 . __( 'The available Pro and Max plans offer user support and many exciting and helpful features for your tables.', 'tablepress' ) . '</strong></p>';
167 178 }
168 179 ?>
@@ -203,33 +214,36 @@
203 214 * @param array<string, mixed> $data Data for this screen.
204 215 * @param array<string, mixed> $box Information about the meta box.
205 216 */
206 217 public function postbox_debug_version_information( array $data, array $box ): void {
207 - $mysqli = ( isset( $GLOBALS['wpdb']->use_mysqli, $GLOBALS['wpdb']->dbh ) && $GLOBALS['wpdb']->use_mysqli );
208 218 ?>
209 219 <p>
210 220 <strong><?php _e( 'Please provide this information in bug reports and support requests.', 'tablepress' ); ?></strong>
211 221 </p>
212 - <p class="ltr">
213 - &middot; Website: <?php echo site_url(); ?>
214 - <br />&middot; TablePress: <?php echo TablePress::version; ?>
215 - <br />&middot; TablePress (DB): <?php echo TablePress::db_version; ?>
216 - <br />&middot; TablePress table scheme: <?php echo TablePress::table_scheme_version; ?>
217 - <br />&middot; Plan: Free
218 - <br />&middot; Plugin installed: <?php echo wp_date( 'Y/m/d H:i:s', $data['first_activation'] ); ?>
219 - <br />&middot; WordPress: <?php echo $GLOBALS['wp_version']; ?>
220 - <br />&middot; Multisite: <?php echo is_multisite() ? 'yes' : 'no'; ?>
221 - <br />&middot; PHP: <?php echo PHP_VERSION; ?>
222 - <br />&middot; mysqli Extension: <?php echo $mysqli ? 'true' : 'false'; ?>
223 - <br />&middot; mySQL (Server): <?php echo $mysqli ? mysqli_get_server_info( $GLOBALS['wpdb']->dbh ) : '<em>no mysqli</em>'; // phpcs:ignore WordPress.DB.RestrictedFunctions.mysql_mysqli_get_server_info ?>
224 - <br />&middot; mySQL (Client): <?php echo $mysqli ? mysqli_get_client_info() : '<em>no mysqli</em>'; // phpcs:ignore WordPress.DB.RestrictedFunctions.mysql_mysqli_get_client_info ?>
225 - <br />&middot; ZIP support: <?php echo $data['zip_support_available'] ? 'yes' : 'no'; ?>
226 - <br />&middot; UTF-8 conversion: <?php echo ( function_exists( 'mb_detect_encoding' ) && function_exists( 'iconv' ) ) ? 'yes' : 'no'; ?>
227 - <br />&middot; WP Memory Limit: <?php echo WP_MEMORY_LIMIT; ?>
228 - <br />&middot; Server Memory Limit: <?php echo (int) @ini_get( 'memory_limit' ) . 'M'; // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged ?>
229 - <br />&middot; WP_DEBUG: <?php echo WP_DEBUG ? 'true' : 'false'; ?>
230 - <br />&middot; WP_POST_REVISIONS: <?php echo is_bool( WP_POST_REVISIONS ) ? ( WP_POST_REVISIONS ? 'true' : 'false' ) : WP_POST_REVISIONS; // @phpstan-ignore-line ?>
231 - </p>
222 + <ul>
223 + <li>Website: <?php echo site_url(); ?></li>
224 + <li>Block Theme: <?php echo wp_is_block_theme() ? 'yes' : 'no'; ?></li>
225 + <li>TablePress: <?php echo TablePress::version; ?></li>
226 + <li>TablePress (DB): <?php echo TablePress::db_version; ?></li>
227 + <li>TablePress table scheme: <?php echo TablePress::table_scheme_version; ?></li>
228 + <li>Plan: Free</li>
229 + <li>Plugin installed: <?php echo wp_date( 'Y/m/d H:i:s', $data['first_activation'] ); ?></li>
230 + <li>WordPress: <?php echo wp_get_wp_version(); ?></li>
231 + <li>Multisite: <?php echo is_multisite() ? 'yes' : 'no'; ?></li>
232 + <li>PHP: <?php echo PHP_VERSION; ?></li>
233 + <li>mySQL (Server): <?php echo ( isset( $GLOBALS['wpdb']->dbh ) && 'mysqli' === get_class( $GLOBALS['wpdb']->dbh ) && function_exists( 'mysqli_get_server_info' ) ) ? mysqli_get_server_info( $GLOBALS['wpdb']->dbh ) : 'no mySQL server'; // phpcs:ignore WordPress.DB.RestrictedFunctions.mysql_mysqli_get_server_info ?></li>
234 + <li>mySQL (Client): <?php echo function_exists( 'mysqli_get_client_info' ) ? mysqli_get_client_info() : 'no mySQL client'; // phpcs:ignore WordPress.DB.RestrictedFunctions.mysql_mysqli_get_client_info ?></li>
235 + <li>mbstring: <?php echo extension_loaded( 'mbstring' ) ? 'yes' : '<span style="color:#800000;font-weight:bold;">no</span>'; ?></li>
236 + <li>ZipArchive: <?php echo class_exists( 'ZipArchive', false ) ? 'yes' : '<span style="color:#800000;font-weight:bold;">no</span>'; ?></li>
237 + <li>DOMDocument: <?php echo class_exists( 'DOMDocument', false ) ? 'yes' : '<span style="color:#800000;font-weight:bold;">no</span>'; ?></li>
238 + <li>simplexml_load_string: <?php echo function_exists( 'simplexml_load_string' ) ? 'yes' : '<span style="color:#800000;font-weight:bold;">no</span>'; ?></li>
239 + <li>libxml_disable_entity_loader: <?php echo function_exists( 'libxml_disable_entity_loader' ) ? 'yes' : '<span style="color:#800000;font-weight:bold;">no</span>'; ?></li>
240 + <li>UTF-8 conversion: <?php echo ( function_exists( 'mb_detect_encoding' ) && function_exists( 'iconv' ) ) ? 'yes' : '<span style="color:#800000;font-weight:bold;">no</span>'; ?></li>
241 + <li>WP Memory Limit: <?php echo WP_MEMORY_LIMIT; ?></li>
242 + <li>Server Memory Limit: <?php echo esc_html( @ini_get( 'memory_limit' ) ); // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged ?></li>
243 + <li>WP_DEBUG: <?php echo WP_DEBUG ? 'true' : 'false'; ?></li>
244 + <li>WP_POST_REVISIONS: <?php echo is_bool( WP_POST_REVISIONS ) ? ( WP_POST_REVISIONS ? 'true' : 'false' ) : WP_POST_REVISIONS; // @phpstan-ignore constant.notFound, phpstanWP.wpConstant.fetch, phpstanWP.wpConstant.fetch, phpstanWP.wpConstant.fetch (The constant is printed for debugging purposes.) ?></li>
245 + </ul>
232 246 <?php
233 247 }
234 248
235 249 /**
@@ -243,12 +257,14 @@
243 257 public function postbox_credits_thanks( array $data, array $box ): void {
244 258 ?>
245 259 <p>
246 260 <?php _e( 'Special Thanks go to:', 'tablepress' ); ?>
247 - <br />&middot; <?php printf( __( 'Allan Jardine for <a href="%s">DataTables</a>,', 'tablepress' ), 'https://www.datatables.net/' ); ?>
248 - <br />&middot; <?php printf( __( 'the translators in the <a href="%s">Plugin Directory</a>,', 'tablepress' ), 'https://translate.wordpress.org/projects/wp-plugins/tablepress/' ); ?>
249 - <br />&middot; <?php _e( 'all customers, donors, contributors, supporters, reviewers, and users of the plugin!', 'tablepress' ); ?>
250 261 </p>
262 + <ul>
263 + <li><?php printf( __( 'Allan Jardine for <a href="%s">DataTables</a>,', 'tablepress' ), 'https://datatables.net/' ); ?></li>
264 + <li><?php printf( __( 'the translators in the <a href="%s">Plugin Directory</a>,', 'tablepress' ), 'https://translate.wordpress.org/projects/wp-plugins/tablepress/' ); ?></li>
265 + <li><?php _e( 'all customers, donors, contributors, supporters, reviewers, and users of the plugin!', 'tablepress' ); ?></li>
266 + </ul>
251 267 <?php
252 268 }
253 269
254 270 } // class TablePress_About_View