Plugin Directory

Changeset 3418248


Ignore:
Timestamp:
12/12/2025 12:42:27 PM (4 months ago)
Author:
wpgenie2
Message:

versions

File:
1 edited

Legend:

Unmodified
Added
Removed
  • simple-storewide-sale-for-woocommerce/tags/1.0.0/simple-storewide-sale-for-woocommerce.php

    r3330527 r3418248  
    1919 * Text Domain:       simple-storewide-sale-for-woocommerce
    2020 * Domain Path:       /languages
    21  * Requires Plugins: woocommerce
     21 * Requires Plugins: WooCommerce
    2222 *
    2323 * WC requires at least: 4.0
     
    2525 */
    2626// If this file is called directly, abort.
    27 if ( !defined( 'ABSPATH' ) ) {
    28     die;
     27if ( ! defined( 'ABSPATH' ) ) {
     28    die;
    2929}
    3030if ( function_exists( 'sssfw' ) ) {
    31     sssfw()->set_basename( false, __FILE__ );
     31    sssfw()->set_basename( false, __FILE__ );
    3232} else {
    33     /**
    34      * Create a helper function for easy SDK access.
    35      */
    36     function sssfw_fs() {
    37         global $sssfw_fs;
    38         if ( !isset( $sssfw_fs ) ) {
    39             // Include Freemius SDK.
    40             require_once __DIR__ . '/vendor/freemius/start.php';
    41             $sssfw_fs = fs_dynamic_init( array(
    42                 'id'               => '18506',
    43                 'slug'             => 'simple-storewide-sale-for-woocommerce',
    44                 'type'             => 'plugin',
    45                 'public_key'       => 'pk_a4d9a444a269fb51ecfbcce526a4f',
    46                 'is_premium'       => false,
    47                 'is_org_compliant' => true,
    48                 'premium_suffix'   => 'Professional',
    49                 'has_addons'       => false,
    50                 'has_paid_plans'   => true,
    51                 'menu'             => array(
    52                     'slug'           => 'simple-storewide-sale-for-woocommerce',
    53                     'override_exact' => true,
    54                     'support'        => true,
    55                     'parent'         => array(
    56                         'slug' => 'options-general.php',
    57                     ),
    58                 ),
    59                 'is_live'          => true,
    60             ) );
    61         }
    62         return $sssfw_fs;
    63     }
     33    /**
     34     * Create a helper function for easy SDK access.
     35     */
     36    function sssfw_fs() {
     37        global $sssfw_fs;
     38        if ( ! isset( $sssfw_fs ) ) {
     39            // Include Freemius SDK.
     40            require_once __DIR__ . '/vendor/freemius/start.php';
     41            $sssfw_fs = fs_dynamic_init(
     42                array(
     43                    'id'               => '18506',
     44                    'slug'             => 'simple-storewide-sale-for-woocommerce',
     45                    'type'             => 'plugin',
     46                    'public_key'       => 'pk_a4d9a444a269fb51ecfbcce526a4f',
     47                    'is_premium'       => false,
     48                    'is_org_compliant' => true,
     49                    'premium_suffix'   => 'Professional',
     50                    'has_addons'       => false,
     51                    'has_paid_plans'   => true,
     52                    'menu'             => array(
     53                        'slug'           => 'simple-storewide-sale-for-woocommerce',
     54                        'override_exact' => true,
     55                        'support'        => true,
     56                        'parent'         => array(
     57                            'slug' => 'options-general.php',
     58                        ),
     59                    ),
     60                    'is_live'          => true,
     61                )
     62            );
     63        }
     64        return $sssfw_fs;
     65    }
    6466
    65     // Init Freemius.
    66     sssfw_fs();
    67     // Signal that SDK was initiated.
    68     do_action( 'sssfw_fs_loaded' );
    69     /**
    70     * Sssfw_fs_settings_url
    71     *
    72     * @return string
    73     */
    74     function sssfw_fs_settings_url() {
    75         return admin_url( 'admin.php?page=wc-settings&tab=simple_storewide_sale' );
    76     }
     67    // Init Freemius.
     68    sssfw_fs();
     69    // Signal that SDK was initiated.
     70    do_action( 'sssfw_fs_loaded' );
     71    /**
     72    * Sssfw_fs_settings_url
     73    *
     74    * @return string
     75    */
     76    function sssfw_fs_settings_url() {
     77        return admin_url( 'admin.php?page=wc-settings&tab=simple_storewide_sale' );
     78    }
    7779
    78     sssfw_fs()->add_filter( 'connect_url', 'sssfw_fs_settings_url' );
    79     sssfw_fs()->add_filter( 'after_skip_url', 'sssfw_fs_settings_url' );
    80     sssfw_fs()->add_filter( 'after_connect_url', 'sssfw_fs_settings_url' );
    81     sssfw_fs()->add_filter( 'after_pending_connect_url', 'sssfw_fs_settings_url' );
     80    sssfw_fs()->add_filter( 'connect_url', 'sssfw_fs_settings_url' );
     81    sssfw_fs()->add_filter( 'after_skip_url', 'sssfw_fs_settings_url' );
     82    sssfw_fs()->add_filter( 'after_connect_url', 'sssfw_fs_settings_url' );
     83    sssfw_fs()->add_filter( 'after_pending_connect_url', 'sssfw_fs_settings_url' );
    8284}
    8385/**
     
    8688 */
    8789require plugin_dir_path( __FILE__ ) . 'includes/class-simple-storewide-sale-for-woocommerce.php';
    88 add_action( 'before_woocommerce_init', function () {
    89     if ( class_exists( \Automattic\WooCommerce\Utilities\FeaturesUtil::class ) ) {
    90         \Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility( 'custom_order_tables', __FILE__, true );
    91     }
    92 } );
     90add_action(
     91    'before_woocommerce_init',
     92    function () {
     93        if ( class_exists( \Automattic\WooCommerce\Utilities\FeaturesUtil::class ) ) {
     94            \Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility( 'custom_order_tables', __FILE__, true );
     95        }
     96    }
     97);
    9398/**
    9499 * Begins execution of the plugin.
     
    101106 */
    102107function run_simple_storewide_sale_for_woocommerce() {
    103     global $sssfw;
    104     $sssfw = new Simple_Storewide_Sale_For_Woocommerce();
    105     $sssfw->run();
     108    global $sssfw;
     109    $sssfw = new Simple_Storewide_Sale_For_Woocommerce();
     110    $sssfw->run();
    106111}
    107112
    108113add_action( 'woocommerce_init', 'run_simple_storewide_sale_for_woocommerce' );
    109 add_action( 'before_woocommerce_init', function () {
    110     if ( class_exists( \Automattic\WooCommerce\Utilities\FeaturesUtil::class ) ) {
    111         \Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility( 'custom_order_tables', __FILE__, true );
    112     }
    113 } );
     114add_action(
     115    'before_woocommerce_init',
     116    function () {
     117        if ( class_exists( \Automattic\WooCommerce\Utilities\FeaturesUtil::class ) ) {
     118            \Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility( 'custom_order_tables', __FILE__, true );
     119        }
     120    }
     121);
Note: See TracChangeset for help on using the changeset viewer.