Changeset 3210586
- Timestamp:
- 12/19/2024 03:42:13 PM (16 months ago)
- Location:
- roi-calculator/trunk
- Files:
-
- 10 added
- 2 deleted
- 2 edited
-
asset (deleted)
-
backend (added)
-
backend/backend.php (added)
-
frontend (added)
-
frontend/asset (added)
-
frontend/asset/css (added)
-
frontend/asset/css/style.css (added)
-
frontend/asset/js (added)
-
frontend/asset/js/chart.js (added)
-
frontend/asset/js/script.js (added)
-
frontend/frontend.php (added)
-
inc (deleted)
-
readme.txt (modified) (1 diff)
-
roi-calculator.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
roi-calculator/trunk/readme.txt
r3195705 r3210586 3 3 Requires at least: 5.5 4 4 Tested up to: 6.7.1 5 Stable tag: 1. 05 Stable tag: 1.1 6 6 License: GPLv3 or later 7 7 License URI: https://www.gnu.org/licenses/gpl-3.0.txt -
roi-calculator/trunk/roi-calculator.php
r3203719 r3210586 3 3 * Plugin Name: Roi Calculator 4 4 * Description: For Using This Plugin you Can Know profitability of an investment. 5 * Version: 1. 05 * Version: 1.1 6 6 * Copyright: 2023 7 7 * License: GPLv3 or later … … 15 15 16 16 17 // define for base name18 define('ROI_BASE_NAME', plugin_basename(__FILE__));19 20 21 // define for plugin file22 define('roi_plugin_file', __FILE__);23 24 25 // define for plugin dir path26 define('ROI_PLUGIN_DIR',plugins_url('', __FILE__));27 17 28 18 29 19 // Include function files 30 include_once(' inc/admin/roi_menu.php');31 include_once(' inc/roi_fronted.php');20 include_once('frontend/frontend.php'); 21 include_once('backend/backend.php'); 32 22 23 function roi_load_script_style() { 24 // Define version variable using file modification time for cache busting 25 $roi_custom_js_version = filemtime( plugin_dir_path( __FILE__ ) . '/frontend/asset/js/script.js' ); 26 $chart_js_version = '1.0.0'; // Static version for chart.js as it is unlikely to change 27 $roi_style_css_version = filemtime( plugin_dir_path( __FILE__ ) . '/frontend/asset/css/style.css' ); 33 28 34 function roi_load_script_style(){ 35 wp_enqueue_script( 'jquery-roi-calculator', ROI_PLUGIN_DIR . '/asset/js/roi_custom.js', array('jquery'), filemtime( ROI_PLUGIN_DIR . '/asset/js/roi_custom.js' ), true );36 wp_enqueue_script( 'chart-js', ROI_PLUGIN_DIR . '/asset/js/chart.js', false, '1.0.0' ,true);37 wp_enqueue_style( 'jquery-calculator-style', ROI_PLUGIN_DIR . '/asset/css/roi_style.css', '', filemtime( ROI_PLUGIN_DIR . '/asset/css/roi_style.css' ));29 // Enqueue scripts and styles with versioning 30 wp_enqueue_script( 'jquery-roi-calculator', plugin_dir_url( __FILE__ ) . '/frontend/asset/js/script.js', array('jquery'), $roi_custom_js_version, true ); 31 wp_enqueue_script( 'chart-js', plugin_dir_url( __FILE__ ) . '/frontend/asset/js/chart.js', false, $chart_js_version, true ); 32 wp_enqueue_style( 'jquery-calculator-style', plugin_dir_url( __FILE__ ) . '/frontend/asset/css/style.css', false, $roi_style_css_version ); 38 33 34 // Localize PHP variables to be used in JS 39 35 $roi_color_var = array( 40 'roi_investd_chart_color' => sanitize_hex_color( get_option('roi_investamount_color', '#BCDCFF')),41 'roi_profit_chart_color' => sanitize_hex_color( get_option('roi_profitamount_color', '#153A5B')),42 'calc_with_chart' => get_option( 'roi_enable_chart', 'true'),43 'calc_chart_type' => sanitize_text_field( get_option('roi_chart_type', 'doughnut_chart')),44 'roi_calc_invest_gain_text' => sanitize_text_field( get_option('roi_invest_gain_text', 'Invest Gain')),45 'roi_calc_roi_text' => sanitize_text_field( get_option('roi_text', 'ROI')),46 'roi_calc_annualized_roi_text' => sanitize_text_field( get_option('annualized_roi_text', 'Annualized ROI')),47 'roi_calc_roi_investment_length_text' => sanitize_text_field( get_option('roi_investment_length_text', 'Investment Length')),48 'roi_calc_invest_amount_text' => sanitize_text_field( get_option('roi_invest_amount_text', 'Investment Amount')),49 'roi_calc_roi_profit_earned_text' => sanitize_text_field( get_option('roi_profit_earned_text', 'Profit Earned')),50 'roi_calc_min_investment_amount' => absint( get_option('min_investment_amount', '1')),51 'roi_calc_max_investment_amount' => absint( get_option('max_investment_amount', '100000')),52 'roi_calc_min_return_amount' => absint( get_option('min_return_amount', '1')),53 'roi_calc_max_return_amount' => absint( get_option('max_return_amount', '100000')),54 'roi_calc_min_investment_period' => absint( get_option('min_investment_period', '1')),55 'roi_calc_max_investment_period' => absint( get_option('max_investment_period', '30')),36 'roi_investd_chart_color' => sanitize_hex_color( get_option( 'roi_investamount_color', '#BCDCFF' ) ), 37 'roi_profit_chart_color' => sanitize_hex_color( get_option( 'roi_profitamount_color', '#153A5B' ) ), 38 'calc_with_chart' => get_option( 'roi_enable_chart', 'true' ), 39 'calc_chart_type' => sanitize_text_field( get_option( 'roi_chart_type', 'doughnut_chart' ) ), 40 'roi_calc_invest_gain_text' => sanitize_text_field( get_option( 'roi_invest_gain_text', 'Invest Gain' ) ), 41 'roi_calc_roi_text' => sanitize_text_field( get_option( 'roi_text', 'ROI' ) ), 42 'roi_calc_annualized_roi_text' => sanitize_text_field( get_option( 'annualized_roi_text', 'Annualized ROI' ) ), 43 'roi_calc_roi_investment_length_text' => sanitize_text_field( get_option( 'roi_investment_length_text', 'Investment Length' ) ), 44 'roi_calc_invest_amount_text' => sanitize_text_field( get_option( 'roi_invest_amount_text', 'Investment Amount' ) ), 45 'roi_calc_roi_profit_earned_text' => sanitize_text_field( get_option( 'roi_profit_earned_text', 'Profit Earned' ) ), 46 'roi_calc_min_investment_amount' => absint( get_option( 'min_investment_amount', '1' ) ), 47 'roi_calc_max_investment_amount' => absint( get_option( 'max_investment_amount', '100000' ) ), 48 'roi_calc_min_return_amount' => absint( get_option( 'min_return_amount', '1' ) ), 49 'roi_calc_max_return_amount' => absint( get_option( 'max_return_amount', '100000' ) ), 50 'roi_calc_min_investment_period' => absint( get_option( 'min_investment_period', '1' ) ), 51 'roi_calc_max_investment_period' => absint( get_option( 'max_investment_period', '30' ) ), 56 52 ); 57 53 54 // Localize the PHP variables to JavaScript 58 55 wp_localize_script( 'jquery-roi-calculator', 'roi_calc_style', $roi_color_var ); 59 56 }
Note: See TracChangeset
for help on using the changeset viewer.