PluginProbe
Tiered Pricing Table for WooCommerce / 8.0.2
Tiered Pricing Table for WooCommerce v8.0.2
8.0.2 7.1.7 7.1.5 7.1.4 7.1.1 6.5.0 6.4.0 6.1.0 trunk 1.0 1.1 2.0 2.0.1 2.0.2 2.1 2.1.1 2.1.2 2.2.0 2.2.1 2.2.2 2.2.3 2.3.0 2.3.1 2.3.2 2.3.3 All 91 releases
← All changes | tier-pricing-table.php +88 -22 1.1 → 8.0.2 View file →
@@ -1,37 +1,103 @@
1 1 <?php
2 2
3 -use TierPricingTable\TierPricingTablePlugin;
4 -
5 3 /**
6 - *
7 4 * Plugin Name: WooCommerce Tiered Price Table
8 - * Description: Allow set price for certain count of price. Shows pricing table. Supports displaying table in tooltip
9 - * Version: 1.1
10 - * Author: bycrik
5 + * Requires Plugins: woocommerce
6 + * Description: Quantity-based discounts with nice-looking reflection on the product page.
7 + * Version: 8.0.2
8 + * Author: U2Code
9 + * Author URI: https://tiered-pricing.com/
10 + * Plugin URI: https://tiered-pricing.com/
11 11 * License: GPLv2 or later
12 12 * License URI: http://www.gnu.org/licenses/gpl-2.0.txt
13 13 * Text Domain: tier-pricing-table
14 - * Domain Path: /languages
14 + * Domain Path: /languages/
15 15 *
16 - * WC requires at least: 3.0
16 + * Requires PHP: 7.4
17 + *
18 + * WC requires at least: 9.0
19 + * WC tested up to: 11.1
17 20 */
18 -
21 +use TierPricingTable\TierPricingTablePlugin;
19 22 // If this file is called directly, abort.
20 -if ( ! defined( 'WPINC' ) ) {
23 +if ( !defined( 'WPINC' ) ) {
21 24 die;
22 25 }
26 +if ( version_compare( phpversion(), '7.4.0', '<' ) ) {
27 + add_action( 'admin_notices', function () {
28 + ?>
29 + <div class='notice notice-error'>
30 + <p>
31 + Tiered Pricing Table plugin requires PHP version to be <b>7.4 or higher</b>. You run PHP
32 + version <?php
33 + echo esc_attr( phpversion() );
34 + ?>
35 + </p>
36 + </div>
37 + <?php
38 + } );
39 + return;
40 +}
41 +if ( !function_exists( 'tpt_initFreemius' ) ) {
42 + function tpt_initFreemius() {
43 + // Create a helper function for easy SDK access.
44 + function tpt_fs() {
45 + global $tpt_fs;
46 + if ( !isset( $tpt_fs ) ) {
47 + // Include Freemius SDK.
48 + require_once dirname( __FILE__ ) . '/freemius/start.php';
49 + $tpt_fs = fs_dynamic_init( array(
50 + 'id' => '3433',
51 + 'slug' => 'tier-pricing-table',
52 + 'type' => 'plugin',
53 + 'public_key' => 'pk_d9f80d20e4c964001b87a062cd2b7',
54 + 'is_premium' => false,
55 + 'premium_suffix' => 'Premium',
56 + 'has_addons' => false,
57 + 'has_paid_plans' => true,
58 + 'trial' => array(
59 + 'days' => 7,
60 + 'is_require_payment' => true,
61 + ),
62 + 'menu' => array(
63 + 'first-path' => 'admin.php?page=tiered-pricing-table-welcome',
64 + 'contact' => false,
65 + 'support' => false,
66 + ),
67 + 'is_org_compliant' => true,
68 + 'is_live' => true,
69 + ) );
70 + }
71 + return $tpt_fs;
72 + }
23 73
24 -call_user_func( function () {
74 + // Init Freemius.
75 + tpt_fs();
76 + // Signal that SDK was initiated.
77 + do_action( 'tpt_fs_loaded' );
78 + }
25 79
26 - require_once plugin_dir_path( __FILE__ ) . 'vendor/autoload.php';
80 +}
81 +if ( !function_exists( 'tpt_fs_activation_url' ) ) {
82 + function tpt_fs_activation_url() : ?string {
83 + return ( tpt_fs()->is_activation_mode() ? tpt_fs()->get_activation_url() : tpt_fs()->get_upgrade_url() );
84 + }
27 85
28 - $main = new TierPricingTablePlugin( __FILE__ );
29 -
30 - register_activation_hook( __FILE__, [ $main, 'activate' ] );
31 -
32 - register_deactivation_hook( __FILE__, [ $main, 'deactivate' ] );
33 -
34 - register_uninstall_hook( __FILE__, [ TierPricingTablePlugin::class, 'uninstall' ] );
35 -
36 - $main->run();
37 -} );
86 +}
87 +if ( function_exists( 'tpt_fs' ) ) {
88 + tpt_fs()->set_basename( false, __FILE__ );
89 + return;
90 +} else {
91 + tpt_initFreemius();
92 + call_user_func( function () {
93 + require_once plugin_dir_path( __FILE__ ) . 'vendor/autoload.php';
94 + $plugin = new TierPricingTablePlugin(__FILE__);
95 + if ( $plugin->checkRequirements() ) {
96 + register_activation_hook( __FILE__, array($plugin, 'activate') );
97 + add_action( 'uninstall', array(TierPricingTablePlugin::class, 'uninstall') );
98 + tpt_fs()->add_action( 'after_uninstall', array(TierPricingTablePlugin::class, 'uninstall') );
99 + $plugin->run();
100 + }
101 + } );
102 +}
103 +define( 'TIERED_PRICING_PRODUCTION', true );