Changeset 2944895
- Timestamp:
- 07/29/2023 12:47:52 PM (3 years ago)
- Location:
- wc-call-for-price/trunk
- Files:
-
- 54 added
- 2 deleted
- 2 edited
-
activation-deactivation.php (added)
-
assets (added)
-
assets/css (added)
-
assets/css/wcp-admin-style.css (added)
-
assets/images (added)
-
assets/images/preset-buttons (added)
-
assets/images/preset-buttons/cfp_1.png (added)
-
assets/images/preset-buttons/cfp_10.png (added)
-
assets/images/preset-buttons/cfp_11.png (added)
-
assets/images/preset-buttons/cfp_12.png (added)
-
assets/images/preset-buttons/cfp_13.png (added)
-
assets/images/preset-buttons/cfp_14.png (added)
-
assets/images/preset-buttons/cfp_15.png (added)
-
assets/images/preset-buttons/cfp_2.png (added)
-
assets/images/preset-buttons/cfp_3.png (added)
-
assets/images/preset-buttons/cfp_4.png (added)
-
assets/images/preset-buttons/cfp_5.png (added)
-
assets/images/preset-buttons/cfp_6.png (added)
-
assets/images/preset-buttons/cfp_7.png (added)
-
assets/images/preset-buttons/cfp_8.png (added)
-
assets/images/preset-buttons/cfp_9.png (added)
-
assets/images/preset-buttons/close.png (added)
-
assets/images/preset-buttons/selected.png (added)
-
assets/images/preset-buttons/unselected.png (added)
-
assets/js (added)
-
assets/js/wcp-admin-script.js (added)
-
images (deleted)
-
includes (added)
-
includes/AdminMenu.php (added)
-
includes/Assets.php (added)
-
includes/Boot.php (added)
-
includes/Constants.php (added)
-
includes/Render.php (added)
-
includes/Upgrader.php (added)
-
languages (added)
-
languages/wc-call-for-price.pot (added)
-
readme.txt (modified) (3 diffs)
-
templates (added)
-
templates/admin (added)
-
templates/admin/layout.php (added)
-
templates/admin/parts (added)
-
templates/admin/parts/footer.php (added)
-
templates/admin/parts/header.php (added)
-
vendor (added)
-
vendor/autoload.php (added)
-
vendor/composer (added)
-
vendor/composer/ClassLoader.php (added)
-
vendor/composer/InstalledVersions.php (added)
-
vendor/composer/LICENSE (added)
-
vendor/composer/autoload_classmap.php (added)
-
vendor/composer/autoload_namespaces.php (added)
-
vendor/composer/autoload_psr4.php (added)
-
vendor/composer/autoload_real.php (added)
-
vendor/composer/autoload_static.php (added)
-
vendor/composer/installed.json (added)
-
vendor/composer/installed.php (added)
-
wc-call-for-price.php (modified) (2 diffs)
-
wp_call_for_price__manage_options_form.php (deleted)
Legend:
- Unmodified
- Added
- Removed
-
wc-call-for-price/trunk/readme.txt
r2943297 r2944895 1 1 === WC Call For Price === 2 2 Contributors: aihimel, iamasadpolash 3 Tags: call for price, woocommerce , plugin, customizable, image upload, admin page, feature rich3 Tags: call for price, woocommerce 4 4 Requires at least: 4.2.2 5 5 Tested up to: 6.2.2 … … 53 53 * Install and Activate 54 54 55 That s all you need to do.55 That's all you need to do. 56 56 57 57 … … 75 75 == Changelog == 76 76 77 = 1.3.0 (29 July, 2023) = 78 * Code refactored 79 * Plugin made translation ready 80 * Admin panel design improved 81 * A new settings link added in plugin list page 82 * Plugin feature activation/deactivation added 83 * Security issue fixes 84 77 85 = 1.2.1 (25 July, 2023) = 78 86 * Tested up-to WordPress 6.2.2 -
wc-call-for-price/trunk/wc-call-for-price.php
r2943295 r2944895 3 3 * Plugin Name: WC Call For Price 4 4 * Plugin URI: http://www.wordpress.org/wc-call-for-price 5 * Version: 1. 2.15 * Version: 1.3.0 6 6 * Author: Aftabul Islam 7 7 * Author URI: https://profiles.wordpress.org/aihimel … … 31 31 defined('ABSPATH') || die(); 32 32 33 defined( 'WC_CALL_FOR_PRICE_VERSION' ) || define('WC_CALL_FOR_PRICE_VERSION', '1.2.0'); 33 require_once( 'vendor/autoload.php' ); 34 35 // Constants 36 defined( 'WC_CALL_FOR_PRICE_VERSION' ) || define('WC_CALL_FOR_PRICE_VERSION', '1.3.0'); 34 37 defined('WC_CALL_FOR_PRICE_PATH') || define('WC_CALL_FOR_PRICE_PATH', plugin_basename(__FILE__)); 38 defined( 'WC_CALL_FOR_PRICE_ACTIVATION_DEACTIVATION_FILE' ) || define( 'WC_CALL_FOR_PRICE_ACTIVATION_DEACTIVATION_FILE', __DIR__ . '/activation-deactivation.php' ); 39 defined('WC_CALL_FOR_PRICE_TEMPLATE_PATH') || define('WC_CALL_FOR_PRICE_TEMPLATE_PATH', plugin_dir_path( __FILE__ ) ); 35 40 36 // Activation and Deactivation Hooks37 register_activation_hook( __FILE__, 'wc_call_for_price__activate');38 register_deactivation_hook( __FILE__, 'wc_call_for_price__deactivate');41 // Activation Deactivation 42 register_activation_hook(WC_CALL_FOR_PRICE_ACTIVATION_DEACTIVATION_FILE, 'wc_call_for_price__activate'); 43 register_deactivation_hook(WC_CALL_FOR_PRICE_ACTIVATION_DEACTIVATION_FILE, 'wc_call_for_price__deactivate'); 39 44 40 // Loading FrontEnd Assets 41 add_action('wp_enqueue_scripts', 'wc_call_for_price__frontend_assets'); 42 // WooCommerce Filter 43 add_filter('woocommerce_empty_price_html', 'wc_call_for_price__call_for_price', 11); 44 45 // Activating the plugin 46 if( ! function_exists('wc_call_for_price__activate') ) { 47 /** 48 * Checking if WooCommerce is installed and activated 49 * @return void 50 */ 51 function wc_call_for_price__activate(){ 52 53 // Checking if the woocommerce plugin is available 54 if( ! class_exists('WooCommerce')){ 55 56 deactivate_plugins(WC_CALL_FOR_PRICE_PATH); 57 58 // Adding an action to show notice at admin panel 59 add_action('admin_notices', 'wc_call_for_price__wc_missing_notice'); 60 61 return; 62 } 63 64 // Creating Options 65 $prefix = 'wc_call_for_price__'; // Prefix for every options 66 add_option($prefix.'text', 'Call For Price', $deprecated = '', $atuoload = 'yes'); 67 add_option($prefix.'show_image', 'off', $deprecated = '', $atuoload = 'yes'); 68 add_option($prefix.'image', 'cfp_1', $deprecated = '', $atuoload = 'yes'); 69 add_option($prefix.'show_uploaded_image', 'off', $deprecated = '', $atuoload = 'yes'); 70 add_option($prefix.'upload_image', '', $deprecated = '', $atuoload = 'yes'); 71 72 // Successful Activation Admin Notice 73 add_action('admin_notices', 'wc_call_for_price__successful_activation_notice'); 74 }} 75 76 // Deactivating the plugin 77 if(!function_exists('wc_call_for_price__deactivate')){ function wc_call_for_price__deactivate(){ 78 79 // Removing Options 80 $prefix = 'wc_call_for_price__'; 81 delete_option($prefix.'text'); 82 delete_option($prefix.'show_image'); 83 delete_option($prefix.'image'); 84 delete_option($prefix.'show_uploaded_image'); 85 delete_option($prefix.'upload_image'); 86 87 }} 88 89 // Plugin Successful Activation Notice 90 if(!function_exists('wc_call_for_price__successful_activation_notice')){function wc_call_for_price__successful_activation_notice(){ 91 printf('<div class="success"><p>'.__('WC Call For Price plugin has been successfully activated. Thank you for choosing this plugin.').'</p></div>'); 92 }} 93 94 // WooCommerce Plugin Missing Notice Function 95 if(!function_exists('wc_call_for_price__wc_missing_notice')){function wc_call_for_price__wc_missing_notice(){ 96 97 printf('<div class="error"><p>'.__("The WC Call for Price plugin will not work without WooCommerce plugin.").'</p></div>'); 98 99 printf('<div class="updated"><p>'.__('Please install <a href="http://wordpress.org/extend/plugins/woocommerce/">WooCommerce plugin</a>').'</p></div>'); 100 101 }} 102 103 // Loading frontend assets 104 if(!function_exists('wc_call_for_price__frontend_assets')){function wc_call_for_price__frontend_assets(){ 105 106 wp_enqueue_script('jquery'); 107 108 }} 109 110 // WC Call For Price Function 111 if(!function_exists('wc_call_for_price__call_for_price')){function wc_call_for_price__call_for_price($price){ 112 $prefix = 'wc_call_for_price__'; 113 114 if(get_option($prefix.'show_uploaded_image') == 'on') return '<img src="'.get_option($prefix.'upload_image').'" />'; 115 116 if(get_option($prefix.'show_image') == 'on') return '<img src="'.plugins_url('/wc-call-for-price/images/'.get_option($prefix.'image')).'.png" />'; 117 else { 118 $temp = get_option($prefix.'text'); 119 if(!empty($temp)) return get_option($prefix.'text'); 120 else return 'Call For Price'; 121 } 122 }} 123 124 125 126 /*--------------------------------------------- ADMIN OPTIONS -----------------------------------------------------*/ 127 add_action('admin_enqueue_scripts', 'wc_call_for_price__admin_assets'); 128 add_action('admin_menu', 'wc_call_for_price__menu'); 129 130 // Loading Admin Assets 131 if(!function_exists('wc_call_for_price__admin_assets')){function wc_call_for_price__admin_assets(){ 132 133 wp_enqueue_media(); 134 wp_enqueue_script('jquery'); 135 136 }} 137 138 // Admin menu Options 139 if(!function_exists('wc_call_for_price__menu')){function wc_call_for_price__menu(){ 140 141 add_submenu_page('woocommerce', 'WooCommerce Call For Price', 'Call For Price', 'manage_options', 'wc-call-for-price', 'wc_call_for_price__menu_options'); 142 143 }} 144 145 // Admin menu Options Page 146 if(!function_exists('wc_call_for_price__menu_options')){function wc_call_for_price__menu_options(){ 147 148 if(!current_user_can('manage_options')) wp_die(__('You don\'t have permission to access this page')); 149 else require_once('wp_call_for_price__manage_options_form.php'); 150 151 }} 152 ?> 45 // Booting the plugin 46 \WCPress\WCP\Boot::init();
Note: See TracChangeset
for help on using the changeset viewer.