Changeset 3468488
- Timestamp:
- 02/24/2026 09:54:46 AM (5 weeks ago)
- Location:
- wc-quantity-plus-minus-button
- Files:
-
- 112 added
- 2 deleted
- 7 edited
-
tags/2.0.5 (added)
-
tags/2.0.5/admin (added)
-
tags/2.0.5/admin/html (added)
-
tags/2.0.5/admin/html/button-settings.php (added)
-
tags/2.0.5/admin/html/custom-css-settings.php (added)
-
tags/2.0.5/admin/html/inputbox-settings.php (added)
-
tags/2.0.5/admin/html/main-page.php (added)
-
tags/2.0.5/admin/html/topbar.php (added)
-
tags/2.0.5/admin/page-loader.php (added)
-
tags/2.0.5/admin/placeholder (added)
-
tags/2.0.5/admin/premium-placeholder.php (added)
-
tags/2.0.5/admin/tracker.php (added)
-
tags/2.0.5/assets (added)
-
tags/2.0.5/assets/css (added)
-
tags/2.0.5/assets/css/admin-common.css (added)
-
tags/2.0.5/assets/css/admin-style.css (added)
-
tags/2.0.5/assets/css/new-admin.css (added)
-
tags/2.0.5/assets/css/style.css (added)
-
tags/2.0.5/assets/fontello (added)
-
tags/2.0.5/assets/fontello/LICENSE.txt (added)
-
tags/2.0.5/assets/fontello/README.txt (added)
-
tags/2.0.5/assets/fontello/config.json (added)
-
tags/2.0.5/assets/fontello/css (added)
-
tags/2.0.5/assets/fontello/css/animation.css (added)
-
tags/2.0.5/assets/fontello/css/wqpmb-icon-codes.css (added)
-
tags/2.0.5/assets/fontello/css/wqpmb-icon-embedded.css (added)
-
tags/2.0.5/assets/fontello/css/wqpmb-icon-ie7-codes.css (added)
-
tags/2.0.5/assets/fontello/css/wqpmb-icon-ie7.css (added)
-
tags/2.0.5/assets/fontello/css/wqpmb-icon.css (added)
-
tags/2.0.5/assets/fontello/demo.html (added)
-
tags/2.0.5/assets/fontello/font (added)
-
tags/2.0.5/assets/fontello/font/wqpmb-icon.eot (added)
-
tags/2.0.5/assets/fontello/font/wqpmb-icon.svg (added)
-
tags/2.0.5/assets/fontello/font/wqpmb-icon.ttf (added)
-
tags/2.0.5/assets/fontello/font/wqpmb-icon.woff (added)
-
tags/2.0.5/assets/fontello/font/wqpmb-icon.woff2 (added)
-
tags/2.0.5/assets/images (added)
-
tags/2.0.5/assets/images/animated-logo.gif (added)
-
tags/2.0.5/assets/images/bg-black-logo.png (added)
-
tags/2.0.5/assets/images/header-logo.png (added)
-
tags/2.0.5/assets/images/logo.png (added)
-
tags/2.0.5/assets/images/menu-icon.png (added)
-
tags/2.0.5/assets/images/plus-minus-small.png (added)
-
tags/2.0.5/assets/images/products (added)
-
tags/2.0.5/assets/images/products/ca-quick-view.png (added)
-
tags/2.0.5/assets/images/products/product-sync-master-sheet.png (added)
-
tags/2.0.5/assets/images/products/ultraaddons-elementor-lite.png (added)
-
tags/2.0.5/assets/images/products/wc-quantity-plus-minus-button.png (added)
-
tags/2.0.5/assets/images/products/woo-min-max-quantity-step-control-single.png (added)
-
tags/2.0.5/assets/images/products/woo-product-table.png (added)
-
tags/2.0.5/assets/images/social (added)
-
tags/2.0.5/assets/images/social/facebook.png (added)
-
tags/2.0.5/assets/images/social/linkedin.png (added)
-
tags/2.0.5/assets/images/social/min-max.png (added)
-
tags/2.0.5/assets/images/social/skype.png (added)
-
tags/2.0.5/assets/images/social/ticket.png (added)
-
tags/2.0.5/assets/images/social/twitter.png (added)
-
tags/2.0.5/assets/images/social/web.png (added)
-
tags/2.0.5/assets/images/social/wpt.png (added)
-
tags/2.0.5/assets/images/social/yelp.png (added)
-
tags/2.0.5/assets/images/social/youtube.png (added)
-
tags/2.0.5/assets/js (added)
-
tags/2.0.5/assets/js/admin-script.js (added)
-
tags/2.0.5/assets/js/ajax-add-to-cart.js (added)
-
tags/2.0.5/assets/js/scripts.js (added)
-
tags/2.0.5/autoloader.php (added)
-
tags/2.0.5/core (added)
-
tags/2.0.5/core/base.php (added)
-
tags/2.0.5/framework (added)
-
tags/2.0.5/framework/ca-framework (added)
-
tags/2.0.5/framework/ca-framework/app (added)
-
tags/2.0.5/framework/ca-framework/app/base (added)
-
tags/2.0.5/framework/ca-framework/app/base/notice-base.php (added)
-
tags/2.0.5/framework/ca-framework/app/notice.php (added)
-
tags/2.0.5/framework/ca-framework/app/require-control.php (added)
-
tags/2.0.5/framework/ca-framework/assets (added)
-
tags/2.0.5/framework/ca-framework/assets/css (added)
-
tags/2.0.5/framework/ca-framework/assets/css/ca-notification.css (added)
-
tags/2.0.5/framework/ca-framework/assets/js (added)
-
tags/2.0.5/framework/ca-framework/assets/js/ajax-update.js (added)
-
tags/2.0.5/framework/ca-framework/example.php (added)
-
tags/2.0.5/framework/ca-framework/form (added)
-
tags/2.0.5/framework/ca-framework/form/fields (added)
-
tags/2.0.5/framework/ca-framework/form/fields/input.php (added)
-
tags/2.0.5/framework/ca-framework/form/fields/select.php (added)
-
tags/2.0.5/framework/ca-framework/form/fields/switch-control.php (added)
-
tags/2.0.5/framework/ca-framework/form/form-bk.php (added)
-
tags/2.0.5/framework/ca-framework/form/form.php (added)
-
tags/2.0.5/framework/ca-framework/form/inc (added)
-
tags/2.0.5/framework/ca-framework/form/inc/control-settings.php (added)
-
tags/2.0.5/framework/ca-framework/form/inc/field-base.php (added)
-
tags/2.0.5/framework/ca-framework/form/inc/field.php (added)
-
tags/2.0.5/framework/ca-framework/form/inc/form-base.php (added)
-
tags/2.0.5/framework/ca-framework/form/inc/form-control.php (added)
-
tags/2.0.5/framework/ca-framework/form/inc/input-base.php (added)
-
tags/2.0.5/framework/ca-framework/form/root.php (added)
-
tags/2.0.5/framework/ca-framework/framework.php (added)
-
tags/2.0.5/framework/ca-framework/loader.php (added)
-
tags/2.0.5/framework/recommeded.php (added)
-
tags/2.0.5/includes (added)
-
tags/2.0.5/includes/admin-menu.php (added)
-
tags/2.0.5/includes/code-snippet-for-help.php (added)
-
tags/2.0.5/includes/feature-loader.php (added)
-
tags/2.0.5/includes/features (added)
-
tags/2.0.5/includes/features/quantiy-archive.php (added)
-
tags/2.0.5/includes/functions.php (added)
-
tags/2.0.5/includes/load-scripts.php (added)
-
tags/2.0.5/init.php (added)
-
tags/2.0.5/readme.txt (added)
-
tags/2.0.5/template (added)
-
tags/2.0.5/template/global (added)
-
tags/2.0.5/template/global/quantity-input.php (added)
-
trunk/admin/freemius-customizer.php (deleted)
-
trunk/admin/html/topbar.php (modified) (1 diff)
-
trunk/admin/page-loader.php (modified) (5 diffs)
-
trunk/admin/premium-placeholder.php (modified) (2 diffs)
-
trunk/autoloader.php (modified) (1 diff)
-
trunk/includes/functions.php (modified) (1 diff)
-
trunk/init.php (modified) (4 diffs)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/vendor (deleted)
Legend:
- Unmodified
- Added
- Removed
-
wc-quantity-plus-minus-button/trunk/admin/html/topbar.php
r3386381 r3468488 34 34 <?php if( ! $this->is_premium){ ?> 35 35 <a class="wqpmb-btn wqpmb-has-icon wqpmb-checkout-button" 36 href=" <?php echo esc_url( wqpmb_fs()->checkout_url() ) ?>"36 href="https://codeastrology.com/downloads/category/premium/" 37 37 target="_blank"> 38 38 <span class="wqpmb_icon-bag"></span> 39 Checkout39 Products 40 40 </a> 41 41 <?php } ?> 42 <a class="wqpmb-btn wqpmb-has-icon"43 42 44 href="https://customers.freemius.com/store/9916/websites" target="_blank">45 <span><i class="wqpmb_icon-user"></i></span>46 Store Login47 </a>48 43 </div> 49 44 </div> -
wc-quantity-plus-minus-button/trunk/admin/page-loader.php
r3386381 r3468488 4 4 use WQPMB\Core\Base; 5 5 use WQPMB\Admin\Premium_Placeholder as Placeholder; 6 // use WQPMB\Admin\Freemius_Customizer as Freemius_Customizer;7 6 8 7 class Page_Loader extends Base … … 28 27 public function __construct() 29 28 { 30 $this->is_premium = wqpmb_ fs()->is_premium();29 $this->is_premium = wqpmb_is_premium(); 31 30 /** 32 31 * No need to call construct … … 47 46 $placeholder->run(); 48 47 49 // if( ! $this->is_premium ){50 // new Freemius_Customizer();51 52 // }53 48 } 54 49 … … 97 92 wp_localize_script( $this->plugin_prefix . '-admin-script', 'WQPMB_ADMIN_DATA', $WQPMB_ADMIN_DATA ); 98 93 99 94 $this->live_chat_script(); 100 95 add_filter('admin_footer_text',[$this, 'admin_footer_text']); 101 96 … … 121 116 } 122 117 118 /** 119 * Adding live chat script in admin footer 120 * 121 * @return void 122 */ 123 protected function live_chat_script() 124 { 125 /** 126 * how to disable live chat 127 * add_filter('wpt_live_chat_bool','__return_false'); 128 */ 129 $live_chat_bool = apply_filters( 'wpt_live_chat_bool', true ); 130 if( ! $live_chat_bool ) return; 131 ?> 132 <!--Start of Tawk.to Script--> 133 <script type="text/javascript"> 134 var Tawk_API=Tawk_API||{}, Tawk_LoadStart=new Date(); 135 (function(){ 136 var s1=document.createElement("script"),s0=document.getElementsByTagName("script")[0]; 137 s1.async=true; 138 s1.src='https://embed.tawk.to/628f5d4f7b967b1179915ad7/1g4009033'; 139 s1.charset='UTF-8'; 140 s1.setAttribute('crossorigin','*'); 141 s0.parentNode.insertBefore(s1,s0); 142 })(); 143 </script> 144 <!--End of Tawk.to Script--> 145 <?php 146 } 123 147 public function admin_footer_text($text) 124 148 { -
wc-quantity-plus-minus-button/trunk/admin/premium-placeholder.php
r3386381 r3468488 9 9 public function __construct() 10 10 { 11 $this->is_premium = wqpmb_ fs()->can_use_premium_code__premium_only();11 $this->is_premium = wqpmb_is_premium(); 12 12 } 13 13 … … 81 81 82 82 <div class="wqpmb-premium-cta"> 83 <a href=" <?php echo esc_url( wqpmb_fs()->get_upgrade_url() ); ?>" class="wqpmb-premium-button">83 <a href="https://codeastrology.com/downloads/" class="wqpmb-premium-button"> 84 84 <span class="wqpmb_icon-basket-1"></span> 85 85 <?php echo esc_html__( 'Upgrade to Premium', 'wc-quantity-plus-minus-button' ); ?> -
wc-quantity-plus-minus-button/trunk/autoloader.php
r2799841 r3468488 4 4 5 5 defined('ABSPATH') || exit; 6 7 /** 8 * Autoloader: All class will call from here by AutoLoader 9 * 10 * @author Saiful Islam<[email protected]> 11 * @since 1.1.2.0 12 * @package WQPMB 13 * @link https://www.php.net/manual/en/language.oop5.autoload.php Autoloader Function 14 */ 15 class Autoloader { 16 6 if( ! class_exists('WQPMB\Autoloader') ) { 17 7 18 8 /** 19 * Run autoloader.9 * Autoloader: All class will call from here by AutoLoader 20 10 * 21 * Register a function as `__autoload()` implementation. 22 * 23 * @since 1.0.0 24 * @access public 25 * @static 11 * @author Saiful Islam<[email protected]> 12 * @since 1.1.2.0 13 * @package WQPMB 14 * @link https://www.php.net/manual/en/language.oop5.autoload.php Autoloader Function 26 15 */ 27 public static function run() { 28 spl_autoload_register([ __CLASS__ , 'autoload' ]); 29 } 16 class Autoloader { 17 30 18 31 /** 32 * Autoload. 33 * 34 * For a given class, check if it exist and load it. 35 * 36 * @since 1.0.0 37 * @access private 38 * @static 39 * 40 * @param string $class Class name. 41 */ 42 private static function autoload( $class ) { 43 44 if (0 !== strpos( $class, __NAMESPACE__ ) ) { 45 return; 19 /** 20 * Run autoloader. 21 * 22 * Register a function as `__autoload()` implementation. 23 * 24 * @since 1.0.0 25 * @access public 26 * @static 27 */ 28 public static function run() { 29 spl_autoload_register([ __CLASS__ , 'autoload' ]); 46 30 } 47 31 32 /** 33 * Autoload. 34 * 35 * For a given class, check if it exist and load it. 36 * 37 * @since 1.0.0 38 * @access private 39 * @static 40 * 41 * @param string $class Class name. 42 */ 43 private static function autoload( $class ) { 44 45 if (0 !== strpos( $class, __NAMESPACE__ ) ) { 46 return; 47 } 48 48 49 $filename = strtolower(50 preg_replace(51 ['/\b' . __NAMESPACE__ . '\\\/', '/_/', '/\\\/'], ['', '-', DIRECTORY_SEPARATOR], $class52 )53 );54 49 55 56 $_dir = str_replace( '\\', '/', dirname( __FILE__ ) . '/' ); 57 $_filename = $_dir . $filename . '.php'; 58 $_filename = realpath( $_filename ); 50 $filename = strtolower( 51 preg_replace( 52 ['/\b' . __NAMESPACE__ . '\\\/', '/_/', '/\\\/'], ['', '-', DIRECTORY_SEPARATOR], $class 53 ) 54 ); 59 55 60 if ( is_readable( $_filename ) ) { 61 require_once $_filename; 56 57 $_dir = str_replace( '\\', '/', dirname( __FILE__ ) . '/' ); 58 $_filename = $_dir . $filename . '.php'; 59 $_filename = realpath( $_filename ); 60 61 if ( is_readable( $_filename ) ) { 62 require_once $_filename; 63 } 64 62 65 } 63 66 64 67 } 65 68 69 Autoloader::run(); 70 66 71 } 67 68 Autoloader::run(); -
wc-quantity-plus-minus-button/trunk/includes/functions.php
r3386381 r3468488 24 24 } 25 25 } 26 27 28 if( ! function_exists( 'wqpmb_fs' ) ){ 29 function wqpmb_fs(){ 30 return new class { 31 public function __call($name, $arguments) 32 { 33 return null; 34 } 35 36 }; 37 } 38 } 39 40 /** 41 * Check is premium version active or not 42 * 43 * even old pro version(WC_Min_Max_Quantity) is active then also return true 44 * 45 * @return boolean 46 */ 47 function wqpmb_is_premium(){ 48 return defined('WQPMB_PRO_ADDON_VERSION'); 49 } 50 /** 51 * Check is premium version installed or not 52 * 53 * @return boolean 54 */ 55 function wqpmb_is_premium_installed(){ 56 return wqpmb_is_premium(); 57 } 58 26 59 27 60 if( !function_exists( 'wqpmb_locate_template' ) ){ -
wc-quantity-plus-minus-button/trunk/init.php
r3386381 r3468488 1 1 <?php 2 3 2 /** 4 3 * Plugin Name: Quantity Plus Minus Button for WooCommerce … … 9 8 * Author URI: https://codeastrology.com/ 10 9 * 11 * Version: 2.0. 010 * Version: 2.0.5 12 11 * Requires at least: 4.0.0 13 12 * Tested up to: 6.8 … … 17 16 * Text Domain: wc-quantity-plus-minus-button 18 17 * Domain Path: /languages 18 * @fs_premium_only /premium/premium-loader.php, /premium/ 19 19 * 20 20 * License: GPL3+ 21 21 * License URI: http://www.gnu.org/licenses/gpl.html 22 22 */ 23 if ( !defined( 'ABSPATH' ) ) { 24 die; 25 } 23 if ( ! defined( 'ABSPATH' ) ) { 24 die(); 25 } 26 27 26 28 if ( !defined( 'WQPMB_VERSION' ) ) { 27 define( 'WQPMB_VERSION', '2.0.0.0' ); 28 } 29 define( 'WQPMB_VERSION', '2.0.5.0' ); 30 } 31 29 32 if ( !defined( 'WQPMB_NAME' ) ) { 30 33 define( 'WQPMB_NAME', 'Quantity Plus Minus Button for WooCommerce' ); 31 34 } 35 32 36 if ( !defined( 'WQPMB_BASE_NAME' ) ) { 33 37 define( 'WQPMB_BASE_NAME', plugin_basename( __FILE__ ) ); 34 38 } 39 35 40 if ( !defined( 'WQPMB_MENU_SLUG' ) ) { 36 // define( 'WQPMB_MENU_SLUG', 'ua-quanity-plus-minus-button' );37 41 define( 'WQPMB_MENU_SLUG', 'wqpmb-settings' ); 38 42 } 43 39 44 if ( !defined( 'WQPMB_MENU_NAME' ) ) { 40 define( 'WQPMB_MENU_NAME', __( 'Plus Minus Button', 'wc-quantity-plus-minus-button' ) ); 41 } 45 define( 'WQPMB_MENU_NAME', 'Plus Minus Button' ); 46 } 47 42 48 if ( !defined( 'WQPMB_BASE_URL' ) ) { 43 define( "WQPMB_BASE_URL", plugins_url() . '/' . plugin_basename( dirname( __FILE__ ) ) . '/' ); 44 } 49 define( "WQPMB_BASE_URL", plugins_url() . '/'. plugin_basename( dirname( __FILE__ ) ) . '/' ); 50 } 51 45 52 if ( !defined( 'WQPMB_MAIN_FILE' ) ) { 46 53 define( "WQPMB_MAIN_FILE", __FILE__ ); … … 49 56 define( "WQPMB_BASE_DIR", str_replace( '\\', '/', dirname( __FILE__ ) ) ); 50 57 } 51 include_once ABSPATH . 'wp-admin/includes/plugin.php'; 52 /** 53 * Freemius integration 54 * 55 */ 56 if ( function_exists( 'wqpmb_fs' ) ) { 57 wqpmb_fs()->set_basename( false, __FILE__ ); 58 } else { 58 59 include_once( ABSPATH . 'wp-admin/includes/plugin.php' ); 60 61 $wqpmb_old_pro_dir = trailingslashit( WP_PLUGIN_DIR ) . 'wc-quantity-plus-minus-button-pro'; 62 63 64 65 if( ! class_exists( 'WQPMB_Button' ) ){ 66 67 include_once dirname( __FILE__ ) . '/autoloader.php'; 68 if( ! function_exists( 'wqpmb_is_premium' ) ){ 69 include_once dirname( __FILE__ ) . '/includes/functions.php'; 70 } 71 72 class WQPMB_Button { 73 /** 74 * Core singleton class 75 * @var self - pattern realization 76 */ 77 private static $_instance; 78 79 /** 80 * Option names Array, We have used to option key for WP Option table 81 * 82 * @var type Array 83 */ 84 public static $option = array( 85 'option' => 'wqpmb_configs', 86 'css' => 'wqpmb_css', 87 ); 88 89 /** 90 * CSS selector for Plus Minus Button tag 91 * 92 * @var type String 93 */ 94 public static $css_selector = '.qib-button-wrapper button.qib-button'; 95 96 //,.qib-button-wrapper .quantity input.input-text.qty.text 97 public static $input_css_selector = '.qib-button-wrapper .quantity input.input-text.qty.text'; 98 99 /** 100 * Trying to commit and push something 101 * Minimum PHP Version 102 * 103 * @since 1.0.0 104 * 105 * @var string Minimum PHP version required to run the plugin. 106 */ 107 const MINIMUM_PHP_VERSION = '5.6'; 108 109 /* 110 * List of Path 111 * 112 * @since 1.0.0 113 * @var array 114 */ 115 protected $paths = array(); 116 117 /** 118 * Set like Constant static array 119 * Get this by getPath() method 120 * Set this by setConstant() method 121 * 122 * @var type array 123 */ 124 private static $constant = array(); 125 126 /** 127 * Set Path 128 * 129 * @param type $path_array 130 * 131 * @since 1.0.0 132 */ 133 public function setPath( $path_array ) { 134 $this->paths = $path_array; 135 } 136 137 /** 138 * 139 * @param type $contanst_array 140 */ 141 private function setConstant( $contanst_array ) { 142 self::$constant = $this->paths; 143 } 144 145 /** 146 * Set Path as like Constant Will Return Full Path 147 * Name should like Constant and full Capitalize 148 * 149 * @param type $name 150 * @return string 151 */ 152 public function path( $name, $_complete_full_file_path = false ) { 153 $path = $this->paths[$name] . $_complete_full_file_path; 154 return $path; 155 } 156 157 /** 158 * To Get Full path to Anywhere based on Constant 159 * 160 * @param type $constant_name 161 * @return type String 162 */ 163 public static function getPath( $constant_name = false ) { 164 $path = self::$constant[$constant_name]; 165 return $path; 166 } 167 168 /** 169 * Getting full Plugin data. We have used __FILE__ for the main plugin file. 170 * 171 * @since V 1.5 172 * @return Array Returnning Array of full Plugin's data for This Woo Product Table plugin 173 */ 174 public static function getPluginData() { 175 return get_plugin_data( __FILE__ ); 176 } 177 178 /** 179 * Getting Version by this Function/Method 180 * 181 * @return type static String 182 */ 183 public static function getVersion() { 184 $data = self::getPluginData(); 185 return $data['Version']; 186 } 187 188 /** 189 * Getting Version by this Function/Method 190 * 191 * @return type static String 192 */ 193 public static function getName() { 194 $data = self::getPluginData(); 195 return $data['Name']; 196 } 197 198 /** 199 * Create instance 200 */ 201 public static function getInstance() { 202 if ( !self::$_instance instanceof self ) { 203 self::$_instance = new self(); 204 } 205 return self::$_instance; 206 } 207 208 public function __construct() { 209 // Declare compatibility with custom order tables for WooCommerce. 210 add_action( 'before_woocommerce_init', function () { 211 if ( class_exists( '\\Automattic\\WooCommerce\\Utilities\\FeaturesUtil' ) ) { 212 \Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility( 'custom_order_tables', __FILE__, true ); 213 } 214 } ); 215 $is_woocommerce = is_plugin_active( 'woocommerce/woocommerce.php' ); 216 if ( !$is_woocommerce ) { 217 add_action( 'admin_notices', [$this, 'admin_notice_missing_main_plugin'] ); 218 return; 219 } 220 // Check for required PHP version 221 if ( version_compare( PHP_VERSION, self::MINIMUM_PHP_VERSION, '<' ) ) { 222 add_action( 'admin_notices', [$this, 'admin_notice_minimum_php_version'] ); 223 return; 224 } 225 add_action( 'plugins_loaded', function () { 226 load_plugin_textdomain( 'wc-quantity-plus-minus-button', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' ); 227 } ); 228 $dir = dirname( __FILE__ ); 229 230 /** 231 * See $path_args for Set Path and set Constant 232 * 233 * @since 1.0.0 234 */ 235 $path_args = array( 236 'PLUGIN_BASE_FOLDER' => plugin_basename( $dir ), 237 'PLUGIN_BASE_FILE' => plugin_basename( __FILE__ ), 238 'BASE_URL' => plugins_url() . '/' . plugin_basename( $dir ) . '/', 239 'BASE_DIR' => str_replace( '\\', '/', $dir . '/' ), 240 ); 241 /** 242 * Set Path Full with Constant as Array 243 * 244 * @since 1.0.0 245 */ 246 $this->setPath( $path_args ); 247 /** 248 * Set Constant 249 * 250 * @since 1.0.0 251 */ 252 $this->setConstant( $path_args ); 253 254 include_once $this->path( 'BASE_DIR', 'includes/admin-menu.php' ); 255 include_once $this->path( 'BASE_DIR', 'includes/load-scripts.php' ); 256 if ( is_admin() ) { 257 $admin_page = new \WQPMB\Admin\Page_Loader(); 258 $admin_page->run(); 259 } 260 261 WQPMB\Includes\Feature_Loader::run(); 262 } 263 264 public function admin_notice_missing_main_plugin() { 265 if ( isset( $_GET['activate'] ) ) { 266 unset($_GET['activate']); 267 } 268 $message = sprintf( 269 /* translators: 1: Plugin name 2: Plugin name */ 270 esc_html__( '"%1$s" requires "%2$s" to be installed and activated.', 'wc-quantity-plus-minus-button' ), 271 '<strong>' . WQPMB_NAME . '</strong>', 272 '<strong><a href="' . esc_url( 'https://wordpress.org/plugins/woocommerce/' ) . '" target="_blank">' . esc_html__( 'WooCommerce', 'wc-quantity-plus-minus-button' ) . '</a></strong>' 273 ); 274 printf( '<div class="notice notice-error is-dismissible"><p>%1$s</p></div>', $message ); 275 } 276 277 public function admin_notice_minimum_php_version() { 278 if ( isset( $_GET['activate'] ) ) { 279 unset($_GET['activate']); 280 } 281 $message = sprintf( 282 /* translators: 1: Plugin name 2: PHP 3: Required PHP version */ 283 esc_html__( '"%1$s" requires "%2$s" version %3$s or greater.', 'wc-quantity-plus-minus-button' ), 284 '<strong>' . WQPMB_NAME . '</strong>', 285 '<strong>' . esc_html__( 'PHP', 'wc-quantity-plus-minus-button' ) . '</strong>', 286 self::MINIMUM_PHP_VERSION 287 ); 288 printf( '<div class="notice notice-error is-dismissible"><p>%1$s</p></div>', $message ); 289 } 290 291 public static function defaultDatas() { 292 $default_data = array( 293 'on_off' => 'on', 294 'css' => false, 295 'quantiy_box_archive' => 1, 296 ); 297 return $default_data; 298 } 299 300 /** 301 * Activation Hook for WordPress 302 */ 303 public static function install() { 304 $default_data = self::defaultDatas(); 305 $option_key = self::$option['option']; 306 $css_key = self::$option['css']; 307 $saved_data = get_option( $option_key ); 308 if ( empty( $saved_data ) ) { 309 update_option( $option_key, $default_data ); 310 } 311 } 312 313 /** 314 * Deactivation Hook for WordPress 315 */ 316 public static function uninstall() { 317 //Nothing for now 318 return; 319 } 320 321 } 322 323 } 324 WQPMB_Button::getInstance(); 325 326 if ( !function_exists( 'wqpmb_load_textdomain' ) ) { 59 327 /** 60 * DO NOT REMOVE THIS IF, IT IS ESSENTIAL FOR THE 61 * `function_exists` CALL ABOVE TO PROPERLY WORK. 62 */ 63 if ( !function_exists( 'wqpmb_fs' ) ) { 64 // Create a helper function for easy SDK access. 65 function wqpmb_fs() { 66 global $wqpmb_fs; 67 if ( !isset( $wqpmb_fs ) ) { 68 // Include Freemius SDK. 69 require_once dirname( __FILE__ ) . '/vendor/freemius/start.php'; 70 $wqpmb_fs = fs_dynamic_init( array( 71 'id' => '21188', 72 'slug' => 'wc-quantity-plus-minus-button', 73 'type' => 'plugin', 74 'public_key' => 'pk_b1d0dd3dec8813c5bc4918992d07a', 75 'is_premium' => false, 76 'has_addons' => false, 77 'has_paid_plans' => true, 78 'trial' => array( 79 'days' => 10, 80 'is_require_payment' => true, 81 ), 82 'has_affiliation' => 'selected', 83 'menu' => array( 84 'slug' => 'wqpmb-settings', 85 'first-path' => 'admin.php?page=wqpmb-settings', 86 ), 87 'is_live' => true, 88 ) ); 89 } 90 return $wqpmb_fs; 91 } 92 93 // Init Freemius. 94 wqpmb_fs(); 95 // Signal that SDK was initiated. 96 do_action( 'wqpmb_fs_loaded' ); 97 } 98 // ... Your plugin's main file logic ... 99 } 100 WQPMB_Button::getInstance(); 101 class WQPMB_Button { 102 /** 103 * Core singleton class 104 * @var self - pattern realization 105 */ 106 private static $_instance; 107 108 /** 109 * Option names Array, We have used to option key for WP Option table 328 * Loads the plugin's translated strings. 110 329 * 111 * @var type Array 112 */ 113 public static $option = array( 114 'option' => 'wqpmb_configs', 115 'css' => 'wqpmb_css', 116 ); 117 118 /** 119 * CSS selector for Plus Minus Button tag 120 * 121 * @var type String 122 */ 123 public static $css_selector = '.qib-button-wrapper button.qib-button'; 124 125 //,.qib-button-wrapper .quantity input.input-text.qty.text 126 public static $input_css_selector = '.qib-button-wrapper .quantity input.input-text.qty.text'; 127 128 /** 129 * Trying to commit and push something 130 * Minimum PHP Version 330 * This function loads the text domain for the 'product-sync-master-sheet' plugin, 331 * enabling translation of plugin strings based on the current locale. It looks for 332 * the translation files in the '/languages' directory of the plugin. 131 333 * 132 334 * @since 1.0.0 133 *134 * @var string Minimum PHP version required to run the plugin.135 335 */ 136 const MINIMUM_PHP_VERSION = '5.6'; 137 138 /* 139 * List of Path 140 * 141 * @since 1.0.0 142 * @var array 143 */ 144 protected $paths = array(); 145 146 /** 147 * Set like Constant static array 148 * Get this by getPath() method 149 * Set this by setConstant() method 150 * 151 * @var type array 152 */ 153 private static $constant = array(); 154 155 /** 156 * Set Path 157 * 158 * @param type $path_array 159 * 160 * @since 1.0.0 161 */ 162 public function setPath( $path_array ) { 163 $this->paths = $path_array; 336 function wqpmb_load_textdomain() { 337 load_plugin_textdomain( 338 'wc-quantity-plus-minus-button', 339 false, 340 dirname( plugin_basename( __FILE__ ) ) . '/languages/' 341 ); 164 342 } 165 166 /** 167 * 168 * @param type $contanst_array 169 */ 170 private function setConstant( $contanst_array ) { 171 self::$constant = $this->paths; 172 } 173 174 /** 175 * Set Path as like Constant Will Return Full Path 176 * Name should like Constant and full Capitalize 177 * 178 * @param type $name 179 * @return string 180 */ 181 public function path( $name, $_complete_full_file_path = false ) { 182 $path = $this->paths[$name] . $_complete_full_file_path; 183 return $path; 184 } 185 186 /** 187 * To Get Full path to Anywhere based on Constant 188 * 189 * @param type $constant_name 190 * @return type String 191 */ 192 public static function getPath( $constant_name = false ) { 193 $path = self::$constant[$constant_name]; 194 return $path; 195 } 196 197 /** 198 * Getting full Plugin data. We have used __FILE__ for the main plugin file. 199 * 200 * @since V 1.5 201 * @return Array Returnning Array of full Plugin's data for This Woo Product Table plugin 202 */ 203 public static function getPluginData() { 204 return get_plugin_data( __FILE__ ); 205 } 206 207 /** 208 * Getting Version by this Function/Method 209 * 210 * @return type static String 211 */ 212 public static function getVersion() { 213 $data = self::getPluginData(); 214 return $data['Version']; 215 } 216 217 /** 218 * Getting Version by this Function/Method 219 * 220 * @return type static String 221 */ 222 public static function getName() { 223 $data = self::getPluginData(); 224 return $data['Name']; 225 } 226 227 /** 228 * Create instance 229 */ 230 public static function getInstance() { 231 if ( !self::$_instance instanceof self ) { 232 self::$_instance = new self(); 233 } 234 return self::$_instance; 235 } 236 237 public function __construct() { 238 // Declare compatibility with custom order tables for WooCommerce. 239 add_action( 'before_woocommerce_init', function () { 240 if ( class_exists( '\\Automattic\\WooCommerce\\Utilities\\FeaturesUtil' ) ) { 241 \Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility( 'custom_order_tables', __FILE__, true ); 242 } 243 } ); 244 $is_woocommerce = is_plugin_active( 'woocommerce/woocommerce.php' ); 245 if ( !$is_woocommerce ) { 246 add_action( 'admin_notices', [$this, 'admin_notice_missing_main_plugin'] ); 247 return; 248 } 249 // Check for required PHP version 250 if ( version_compare( PHP_VERSION, self::MINIMUM_PHP_VERSION, '<' ) ) { 251 add_action( 'admin_notices', [$this, 'admin_notice_minimum_php_version'] ); 252 return; 253 } 254 add_action( 'plugins_loaded', function () { 255 load_plugin_textdomain( 'wc-quantity-plus-minus-button', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' ); 256 } ); 257 $dir = dirname( __FILE__ ); 258 include_once $dir . '/autoloader.php'; 259 /** 260 * See $path_args for Set Path and set Constant 261 * 262 * @since 1.0.0 263 */ 264 $path_args = array( 265 'PLUGIN_BASE_FOLDER' => plugin_basename( $dir ), 266 'PLUGIN_BASE_FILE' => plugin_basename( __FILE__ ), 267 'BASE_URL' => plugins_url() . '/' . plugin_basename( $dir ) . '/', 268 'BASE_DIR' => str_replace( '\\', '/', $dir . '/' ), 269 ); 270 /** 271 * Set Path Full with Constant as Array 272 * 273 * @since 1.0.0 274 */ 275 $this->setPath( $path_args ); 276 /** 277 * Set Constant 278 * 279 * @since 1.0.0 280 */ 281 $this->setConstant( $path_args ); 282 include_once $this->path( 'BASE_DIR', 'includes/functions.php' ); 283 include_once $this->path( 'BASE_DIR', 'includes/admin-menu.php' ); 284 include_once $this->path( 'BASE_DIR', 'includes/load-scripts.php' ); 285 if ( is_admin() ) { 286 $admin_page = new \WQPMB\Admin\Page_Loader(); 287 $admin_page->run(); 288 } 289 $pro_file = dirname( __FILE__ ) . '/premium/premium-loader.php'; 290 if ( wqpmb_fs()->can_use_premium_code__premium_only() && file_exists( $pro_file ) ) { 291 require_once $pro_file; 292 } 293 WQPMB\Includes\Feature_Loader::run(); 294 } 295 296 public function admin_notice_missing_main_plugin() { 297 if ( isset( $_GET['activate'] ) ) { 298 unset($_GET['activate']); 299 } 300 $message = sprintf( 301 /* translators: 1: Plugin name 2: Plugin name */ 302 esc_html__( '"%1$s" requires "%2$s" to be installed and activated.', 'wc-quantity-plus-minus-button' ), 303 '<strong>' . WQPMB_NAME . '</strong>', 304 '<strong><a href="' . esc_url( 'https://wordpress.org/plugins/woocommerce/' ) . '" target="_blank">' . esc_html__( 'WooCommerce', 'wc-quantity-plus-minus-button' ) . '</a></strong>' 305 ); 306 printf( '<div class="notice notice-error is-dismissible"><p>%1$s</p></div>', $message ); 307 } 308 309 public function admin_notice_minimum_php_version() { 310 if ( isset( $_GET['activate'] ) ) { 311 unset($_GET['activate']); 312 } 313 $message = sprintf( 314 /* translators: 1: Plugin name 2: PHP 3: Required PHP version */ 315 esc_html__( '"%1$s" requires "%2$s" version %3$s or greater.', 'wc-quantity-plus-minus-button' ), 316 '<strong>' . WQPMB_NAME . '</strong>', 317 '<strong>' . esc_html__( 'PHP', 'wc-quantity-plus-minus-button' ) . '</strong>', 318 self::MINIMUM_PHP_VERSION 319 ); 320 printf( '<div class="notice notice-error is-dismissible"><p>%1$s</p></div>', $message ); 321 } 322 323 public static function defaultDatas() { 324 $default_data = array( 325 'on_off' => 'on', 326 'css' => false, 327 'quantiy_box_archive' => 1, 328 ); 329 return $default_data; 330 } 331 332 /** 333 * Activation Hook for WordPress 334 */ 335 public static function install() { 336 $default_data = self::defaultDatas(); 337 $option_key = self::$option['option']; 338 $css_key = self::$option['css']; 339 $saved_data = get_option( $option_key ); 340 if ( empty( $saved_data ) ) { 341 update_option( $option_key, $default_data ); 342 } 343 } 344 345 /** 346 * Deactivation Hook for WordPress 347 */ 348 public static function uninstall() { 349 //Nothing for now 350 return; 351 } 352 353 } 354 355 /** 356 * Plugin Install and Uninstall 357 */ 343 add_action( 'init', 'wqpmb_load_textdomain' ); 344 345 } 346 358 347 register_activation_hook( __FILE__, array('WQPMB_Button', 'install') ); 359 348 register_deactivation_hook( __FILE__, array('WQPMB_Button', 'uninstall') ); -
wc-quantity-plus-minus-button/trunk/readme.txt
r3386382 r3468488 5 5 Requires at least: 4.0.0 6 6 Tested up to: 6.8 7 Stable tag: 2.0. 07 Stable tag: 2.0.5 8 8 Requires PHP: 5.4 9 9 License: GPL3+ … … 154 154 == Change log == 155 155 156 = 2.0.5 = 157 * Fixed: text-domain issue fixed. 158 * Bug fixed. 159 156 160 = 2.0.0 = 157 161 * Fixed: fatal error issue has been fixed.
Note: See TracChangeset
for help on using the changeset viewer.