PluginProbe
TablePress – Tables in WordPress made easy / 2.1.8
TablePress – Tables in WordPress made easy v2.1.8
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 / tablepress.php

tablepress.php in TablePress – Tables in WordPress made easy 2.1.8, at tablepress.php

140 lines 4.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * WordPress plugin "TablePress" main file, responsible for initiating the plugin.
4 *
5 * @package TablePress
6 * @author Tobias Bäthge
7 * @version 2.1.8
8 *
9 *
10 * Plugin Name: TablePress
11 * Plugin URI: https://tablepress.org/
12 * Description: Embed beautiful and interactive tables into your WordPress website’s posts and pages, without having to write code!
13 * Version: 2.1.8
14 * Requires at least: 5.8
15 * Requires PHP: 5.6.20
16 * Author: Tobias Bäthge
17 * Author URI: https://tablepress.org/
18 * Author email: wordpress@tobias.baethge.com
19 * License: GPL 2
20 * Donate URI: https://tablepress.org/donate/
21 *
22 *
23 * Copyright 2012-2023 Tobias Bäthge
24 *
25 * TablePress is free software: you can redistribute it and/or modify
26 * it under the terms of the GNU General Public License, version 2, as published by
27 * the Free Software Foundation.
28 *
29 * TablePress is distributed in the hope that it will be useful,
30 * but WITHOUT ANY WARRANTY; without even the implied warranty of
31 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
32 * GNU General Public License for more details.
33 *
34 * You should have received a copy of the GNU General Public License
35 * along with WordPress. If not, see https://www.gnu.org/licenses/gpl-2.0.html.
36 */
37
38 // Prohibit direct script loading.
39 defined( 'ABSPATH' ) || die( 'No direct script access allowed!' );
40
41 if ( function_exists( 'tb_tp_fs' ) ) {
42 tb_tp_fs()->set_basename( false, __FILE__ );
43 } else {
44 if ( ! function_exists( 'tb_tp_fs' ) ) {
45 /**
46 * Helper function for easier Freemius SDK access.
47 *
48 * @since 2.0.0
49 *
50 * @return Freemius Freemius SDK instance.
51 */
52 function tb_tp_fs() {
53 global $tb_tp_fs;
54
55 if ( ! isset( $tb_tp_fs ) ) {
56 // Include Freemius SDK.
57 require_once __DIR__ . '/libraries/freemius/start.php';
58
59 $tb_tp_fs = fs_dynamic_init( array(
60 'id' => '10340',
61 'slug' => 'tablepress',
62 'type' => 'plugin',
63 'public_key' => 'pk_b215ca1bb4041cf43ed137ae7665b',
64 'is_premium' => false,
65 'has_addons' => false,
66 'has_paid_plans' => true,
67 'menu' => array(
68 'slug' => 'tablepress',
69 'contact' => false,
70 'support' => false,
71 'account' => false,
72 'pricing' => false,
73 ),
74 'opt_in_moderation' => array(
75 'new' => true,
76 'updates' => false,
77 'localhost' => false,
78 ),
79 'is_live' => true,
80 ) );
81 }
82
83 return $tb_tp_fs;
84 }
85
86 // Init Freemius.
87 tb_tp_fs();
88
89 // Load the TablePress plugin icon for the Freemius opt-in/activation screen.
90 tb_tp_fs()->add_filter(
91 'plugin_icon',
92 static function() {
93 return __DIR__ . '/admin/img/tablepress.png';
94 }
95 );
96
97 // Hide the tabs navigation on Freemius screens.
98 tb_tp_fs()->add_filter( 'hide_account_tabs', '__return_true' );
99
100 // Hide the Powered by Freemius tab from generated pages, like "Upgrade" or "Pricing".
101 tb_tp_fs()->add_filter( 'hide_freemius_powered_by', '__return_true' );
102
103 // Use different arrow icons in the admin menu.
104 tb_tp_fs()->override_i18n( array(
105 'symbol_arrow-left' => '&larr;',
106 'symbol_arrow-right' => '&rarr;',
107 ) );
108
109 // Signal that SDK was initiated.
110 do_action( 'tb_tp_fs_loaded' );
111 }
112
113 /*
114 * Define certain plugin variables as constants.
115 */
116 if ( ! defined( 'TABLEPRESS_ABSPATH' ) ) {
117 define( 'TABLEPRESS_ABSPATH', trailingslashit( __DIR__ ) );
118 }
119 if ( ! defined( 'TABLEPRESS__FILE__' ) ) {
120 define( 'TABLEPRESS__FILE__', __FILE__ );
121 }
122 if ( ! defined( 'TABLEPRESS_BASENAME' ) ) {
123 define( 'TABLEPRESS_BASENAME', plugin_basename( TABLEPRESS__FILE__ ) );
124 }
125 if ( ! defined( 'TABLEPRESS_JSON_OPTIONS' ) ) {
126 // JSON_UNESCAPED_SLASHES: Don't escape slashes, e.g. to make search/replace of URLs in the database easier.
127 define( 'TABLEPRESS_JSON_OPTIONS', JSON_UNESCAPED_SLASHES );
128 }
129
130 /*
131 * Load TablePress class, which holds common functions and variables.
132 */
133 require_once TABLEPRESS_ABSPATH . 'classes/class-tablepress.php';
134
135 /*
136 * Start up TablePress on WordPress's "init" action hook.
137 */
138 add_action( 'init', array( 'TablePress', 'run' ) );
139 }
140