PluginProbe
TablePress – Tables in WordPress made easy / 3.0
TablePress – Tables in WordPress made easy v3.0
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 2.4.4 All 44 releases
tablepress / views / view-about.php

view-about.php in TablePress – Tables in WordPress made easy 3.0, at views/view-about.php

257 lines 12.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * About TablePress View
4 *
5 * @package TablePress
6 * @subpackage Views
7 * @author Tobias Bäthge
8 * @since 1.0.0
9 */
10
11 // Prohibit direct script loading.
12 defined( 'ABSPATH' ) || die( 'No direct script access allowed!' );
13
14 /**
15 * About TablePress View class
16 *
17 * @package TablePress
18 * @subpackage Views
19 * @author Tobias Bäthge
20 * @since 1.0.0
21 */
22 class TablePress_About_View extends TablePress_View {
23
24 /**
25 * Number of screen columns for post boxes on this screen.
26 *
27 * @since 1.0.0
28 */
29 protected int $screen_columns = 2;
30
31 /**
32 * Set up the view with data and do things that are specific for this view.
33 *
34 * @since 1.0.0
35 *
36 * @param string $action Action for this view.
37 * @param array<string, mixed> $data Data for this view.
38 */
39 #[\Override]
40 public function setup( /* string */ $action, array $data ) /* : void */ {
41 // Don't use type hints in the method declaration to prevent PHP errors, as the method is inherited.
42
43 parent::setup( $action, $data );
44
45 $this->add_text_box( 'spacer', array( $this, 'textbox_spacer' ), 'normal' );
46 $this->add_text_box( 'spacer', array( $this, 'textbox_spacer' ), 'side' );
47 $this->add_meta_box( 'plugin-purpose', __( 'Plugin Purpose', 'tablepress' ), array( $this, 'postbox_plugin_purpose' ), 'normal' );
48 $this->add_meta_box( 'usage', __( 'Usage', 'tablepress' ), array( $this, 'postbox_usage' ), 'normal' );
49 $this->add_meta_box( 'more-information', __( 'More Information and Documentation', 'tablepress' ), array( $this, 'postbox_more_information' ), 'normal' );
50 $this->add_meta_box( 'help-support', __( 'Help and Support', 'tablepress' ), array( $this, 'postbox_help_support' ), 'normal' );
51 $this->add_meta_box( 'author-license', __( 'Author and License', 'tablepress' ), array( $this, 'postbox_author_license' ), 'side' );
52 $this->add_meta_box( 'credits-thanks', __( 'Credits and Thanks', 'tablepress' ), array( $this, 'postbox_credits_thanks' ), 'side' );
53 $this->add_meta_box( 'debug-version-information', __( 'Debug and Version Information', 'tablepress' ), array( $this, 'postbox_debug_version_information' ), 'side' );
54 }
55
56 /**
57 * Prints the screen head spacer.
58 *
59 * @since 2.0.0
60 *
61 * @param array<string, mixed> $data Data for this screen.
62 * @param array<string, mixed> $box Information about the text box.
63 */
64 public function textbox_spacer( array $data, array $box ): void {
65 echo '<p></p>';
66 }
67
68 /**
69 * Print the content of the "Plugin Purpose" post meta box.
70 *
71 * @since 1.0.0
72 *
73 * @param array<string, mixed> $data Data for this screen.
74 * @param array<string, mixed> $box Information about the meta box.
75 */
76 public function postbox_plugin_purpose( array $data, array $box ): void {
77 ?>
78 <p>
79 <?php _e( 'TablePress allows you to create and manage tables in the admin area of WordPress.', 'tablepress' ); ?>
80 <?php _e( 'Tables may contain text, numbers, formulas, and even HTML code (e.g. to include images or links).', 'tablepress' ); ?>
81 <?php _e( 'You can embed the tables into posts, pages, or other site areas using a block in the block editor.', 'tablepress' ); ?>
82 </p>
83 <?php
84 }
85
86 /**
87 * Print the content of the "Usage" post meta box.
88 *
89 * @since 1.0.0
90 *
91 * @param array<string, mixed> $data Data for this screen.
92 * @param array<string, mixed> $box Information about the meta box.
93 */
94 public function postbox_usage( array $data, array $box ): void {
95 ?>
96 <p>
97 <?php _e( 'At first, you should add or import a table.', 'tablepress' ); ?>
98 <?php _e( 'This means that you either let the plugin create an empty table for you or that you load an existing table from either a CSV, HTML, JSON, XLS, or XLSX file.', 'tablepress' ); ?>
99 </p>
100 <p>
101 <?php _e( 'Then, you can edit your data or change the structure of your table (e.g. by inserting, deleting, moving, or swapping rows or columns or sorting them) and select specific table features like alternating row colors or whether to print the name or description, if you want.', 'tablepress' ); ?>
102 <?php _e( 'To easily add a link or an image to a cell, use the provided buttons.', 'tablepress' ); ?>
103 <?php _e( 'Those will ask you for the necessary information and corresponding HTML code will be added to the cell automatically.', 'tablepress' ); ?>
104 </p>
105 <p>
106 <?php
107 // Show the instructions string depending on whether the Block Editor is used on the site or not.
108 if ( $data['site_uses_block_editor'] ) {
109 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' ) );
110 } else {
111 _e( 'To insert a table into a post or page, paste its Shortcode at the desired place in the editor.', 'tablepress' );
112 echo ' ';
113 _e( 'Each table has a unique ID that needs to be adjusted in that Shortcode.', 'tablepress' );
114 }
115 ?>
116 </p>
117 <p>
118 <?php _e( 'Tables can be styled by changing and adding CSS commands.', 'tablepress' ); ?>
119 <?php _e( 'The plugin ships with default CSS stylesheets, which can be customized with own code or replaced with other stylesheets.', 'tablepress' ); ?>
120 <?php _e( 'For this, each table is given certain CSS classes that can be used as CSS selectors.', 'tablepress' ); ?>
121 <?php printf( __( 'Please see the <a href="%s">Documentation</a> for a list of these selectors and for styling examples.', 'tablepress' ), 'https://tablepress.org/documentation/' ); ?>
122 </p>
123 <?php
124 }
125
126 /**
127 * Print the content of the "More Information and Documentation" post meta box.
128 *
129 * @since 1.0.0
130 *
131 * @param array<string, mixed> $data Data for this screen.
132 * @param array<string, mixed> $box Information about the meta box.
133 */
134 public function postbox_more_information( array $data, array $box ): void {
135 ?>
136 <p>
137 <?php printf( __( 'More information about TablePress can be found on the <a href="%1$s">plugin website</a> or on its page in the <a href="%2$s">WordPress Plugin Directory</a>.', 'tablepress' ), 'https://tablepress.org/', 'https://wordpress.org/plugins/tablepress/' ); ?>
138 <?php printf( __( 'For technical information, please see the <a href="%s">Documentation</a>.', 'tablepress' ), 'https://tablepress.org/documentation/' ); ?>
139 <?php printf( __( 'Common questions are answered in the <a href="%s">FAQ</a>.', 'tablepress' ), 'https://tablepress.org/faq/' ); ?>
140 </p>
141 <?php
142 }
143
144 /**
145 * Print the content of the "Author and License" post meta box.
146 *
147 * @since 1.0.0
148 *
149 * @param array<string, mixed> $data Data for this screen.
150 * @param array<string, mixed> $box Information about the meta box.
151 */
152 public function postbox_author_license( array $data, array $box ): void {
153 ?>
154 <p>
155 <?php printf( __( 'This plugin was written and developed by <a href="%s">Tobias Bäthge</a>.', 'tablepress' ), 'https://tobias.baethge.com/' ); ?>
156 <?php _e( 'It is licensed as Free Software under GNU General Public License 2 (GPL 2).', 'tablepress' ); ?>
157 </p>
158 <p>
159 <?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' ); ?>
160 </p>
161 <?php
162 if ( tb_tp_fs()->is_free_plan() ) {
163 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' ) . ' '
164 . __( 'The available Pro and Max plans offer user support and many exciting and helpful features for your tables.', 'tablepress' ) . '</strong></p>';
165 }
166 ?>
167 <?php
168 }
169
170 /**
171 * Print the content of the "Help and Support" post meta box.
172 *
173 * @since 1.0.0
174 *
175 * @param array<string, mixed> $data Data for this screen.
176 * @param array<string, mixed> $box Information about the meta box.
177 */
178 public function postbox_help_support( array $data, array $box ): void {
179 if ( tb_tp_fs()->is_free_plan() ) {
180 ?>
181 <h4><?php _e( 'Premium Support', 'tablepress' ); ?></h4>
182 <p>
183 <?php _e( 'Users with a valid TablePress Premium license plan are eligible for Priority Email Support, directly from the plugin developer!', 'tablepress' ); ?>
184 <strong><?php printf( __( '<a href="%s">Find out more!</a>', 'tablepress' ), 'https://tablepress.org/premium/?utm_source=plugin&utm_medium=textlink&utm_content=about-screen' ); ?></strong>
185 </p>
186 <h4><?php _e( 'Community Support for users of the Free version', 'tablepress' ); ?></h4>
187 <p>
188 <?php printf( __( '<a href="%1$s">Support</a> is provided through the <a href="%2$s">WordPress Support Forums</a>.', 'tablepress' ), 'https://tablepress.org/support/', 'https://wordpress.org/support/plugin/tablepress' ); ?>
189 <?php printf( __( 'Before asking for support, please carefully read the <a href="%s">Frequently Asked Questions</a>, where you will find answers to the most common questions, and search through the forums.', 'tablepress' ), 'https://tablepress.org/faq/' ); ?>
190 <?php printf( __( 'If you do not find an answer there, please <a href="%s">open a new thread</a> in the WordPress Support Forums.', 'tablepress' ), 'https://wordpress.org/support/plugin/tablepress' ); ?>
191 </p>
192 <?php
193 }
194 }
195
196 /**
197 * Print the content of the "Debug and Version Information" post meta box.
198 *
199 * @since 1.0.0
200 *
201 * @param array<string, mixed> $data Data for this screen.
202 * @param array<string, mixed> $box Information about the meta box.
203 */
204 public function postbox_debug_version_information( array $data, array $box ): void {
205 ?>
206 <p>
207 <strong><?php _e( 'Please provide this information in bug reports and support requests.', 'tablepress' ); ?></strong>
208 </p>
209 <ul>
210 <li>Website: <?php echo site_url(); ?></li>
211 <li>TablePress: <?php echo TablePress::version; ?></li>
212 <li>TablePress (DB): <?php echo TablePress::db_version; ?></li>
213 <li>TablePress table scheme: <?php echo TablePress::table_scheme_version; ?></li>
214 <li>Plan: Free</li>
215 <li>Plugin installed: <?php echo wp_date( 'Y/m/d H:i:s', $data['first_activation'] ); ?></li>
216 <li>WordPress: <?php echo $GLOBALS['wp_version']; ?></li>
217 <li>Multisite: <?php echo is_multisite() ? 'yes' : 'no'; ?></li>
218 <li>PHP: <?php echo PHP_VERSION; ?></li>
219 <li>mySQL (Server): <?php echo ( isset( $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>
220 <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>
221 <li>mbstring: <?php echo extension_loaded( 'mbstring' ) ? 'yes' : '<span style="color:#800000;font-weight:bold;">no</span>'; ?></li>
222 <li>ZipArchive: <?php echo class_exists( 'ZipArchive', false ) ? 'yes' : '<span style="color:#800000;font-weight:bold;">no</span>'; ?></li>
223 <li>DOMDocument: <?php echo class_exists( 'DOMDocument', false ) ? 'yes' : '<span style="color:#800000;font-weight:bold;">no</span>'; ?></li>
224 <li>simplexml_load_string: <?php echo function_exists( 'simplexml_load_string' ) ? 'yes' : '<span style="color:#800000;font-weight:bold;">no</span>'; ?></li>
225 <li>libxml_disable_entity_loader: <?php echo function_exists( 'libxml_disable_entity_loader' ) ? 'yes' : '<span style="color:#800000;font-weight:bold;">no</span>'; ?></li>
226 <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>
227 <li>WP Memory Limit: <?php echo WP_MEMORY_LIMIT; ?></li>
228 <li>Server Memory Limit: <?php echo esc_html( @ini_get( 'memory_limit' ) ); // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged ?></li>
229 <li>WP_DEBUG: <?php echo WP_DEBUG ? 'true' : 'false'; ?></li>
230 <li>WP_POST_REVISIONS: <?php echo is_bool( WP_POST_REVISIONS ) ? ( WP_POST_REVISIONS ? 'true' : 'false' ) : WP_POST_REVISIONS; // @phpstan-ignore constant.notFound ?></li>
231 </ul>
232 <?php
233 }
234
235 /**
236 * Print the content of the "Credits and Thanks" post meta box.
237 *
238 * @since 1.0.0
239 *
240 * @param array<string, mixed> $data Data for this screen.
241 * @param array<string, mixed> $box Information about the meta box.
242 */
243 public function postbox_credits_thanks( array $data, array $box ): void {
244 ?>
245 <p>
246 <?php _e( 'Special Thanks go to:', 'tablepress' ); ?>
247 </p>
248 <ul>
249 <li><?php printf( __( 'Allan Jardine for <a href="%s">DataTables</a>,', 'tablepress' ), 'https://datatables.net/' ); ?></li>
250 <li><?php printf( __( 'the translators in the <a href="%s">Plugin Directory</a>,', 'tablepress' ), 'https://translate.wordpress.org/projects/wp-plugins/tablepress/' ); ?></li>
251 <li><?php _e( 'all customers, donors, contributors, supporters, reviewers, and users of the plugin!', 'tablepress' ); ?></li>
252 </ul>
253 <?php
254 }
255
256 } // class TablePress_About_View
257