Plugin Directory

Changeset 3324153


Ignore:
Timestamp:
07/08/2025 08:52:15 AM (8 months ago)
Author:
worldweb
Message:
  • Fixed activation issue with the Pro plugin
Location:
loan-calculator-wp
Files:
70 added
2 edited

Legend:

Unmodified
Added
Removed
  • loan-calculator-wp/trunk/loan-calculator-wp.php

    r3292676 r3324153  
    44 * Plugin URI: https://www.worldwebtechnology.com/
    55 * Description: Advanced Loan Calculator for Home Loans, Personal Loans, and various other types of loans. Includes features like a repayment chart, amortization table, video tab, balloon payment option, and supports all currencies. Use the contact form shortcode for easy access.
    6  * Version: 2.0.1
     6 * Version: 2.0.2
    77 * Author: World Web Technology
    88 * Author URI: https://www.worldwebtechnology.com/
     
    2727 */
    2828if (!defined('WW_LOAN_CALCULATOR_VERSION')) {
    29     define('WW_LOAN_CALCULATOR_VERSION', '2.0.1'); //version of plugin
     29    define('WW_LOAN_CALCULATOR_VERSION', '2.0.2'); //version of plugin
    3030}
    3131if (!defined('WW_LOAN_CALCULATOR_TEXT_DOMAIN')) { //check if variable is not defined previous then define it
     
    371371add_filter( 'upgrader_install_package_result', 'lcp_upgrader_install_package_result', 10, 2 );
    372372function lcp_upgrader_install_package_result( $result, $hook_extra ) {
    373 
    374     if( isset($result->errors['folder_exists'][0]) && $result->errors['folder_exists'][0] != "Destination folder already exists." ) {
    375 
    376         if (strpos($result['destination_name'], 'worldweb-loan-calculator-wp-pro-') !== false) {
    377             if( ! empty( $result['destination'] ) ) {
    378                 //first rename the plugin directory downloaded from git as it contains username and release informations.
    379                 $plugin_dir       = WP_PLUGIN_DIR; // Plugin directory path
    380                 $desired_folder   = 'loan-calculator-wp-pro'; // Correct plugin folder name
    381                 $plugin_main_file = 'loan-calculator-wp-pro.php'; // Main plugin file name
    382                 $old_folder_path  = $plugin_dir . '/' . $result['destination_name'];
    383                 $new_folder_path  = $plugin_dir . '/' . $desired_folder;
    384 
    385                 // Get the active plugins list
    386                 $active_plugins = get_option('active_plugins');
    387 
    388                 // Deactivate the plugin before renaming if it's active
    389                 $was_active = in_array($result['destination_name'] . '/' . $plugin_main_file, $active_plugins);
     373    if (strpos($result['destination_name'], 'worldweb-loan-calculator-wp-pro-') !== false) {
     374        if( ! empty( $result['destination'] ) ) {
     375            //first rename the plugin directory downloaded from git as it contains username and release informations.
     376            $plugin_dir       = WP_PLUGIN_DIR; // Plugin directory path
     377            $desired_folder   = 'loan-calculator-wp-pro'; // Correct plugin folder name
     378            $plugin_main_file = 'loan-calculator-wp-pro.php'; // Main plugin file name
     379            $old_folder_path  = $plugin_dir . '/' . $result['destination_name'];
     380            $new_folder_path  = $plugin_dir . '/' . $desired_folder;
     381
     382            // Get the active plugins list
     383            $active_plugins = get_option('active_plugins');
     384
     385            // Deactivate the plugin before renaming if it's active
     386            $was_active = in_array($result['destination_name'] . '/' . $plugin_main_file, $active_plugins);
     387
     388            if ($was_active) {
     389                deactivate_plugins($result['destination_name'] . '/' . $plugin_main_file);
     390            }
     391
     392            // Rename the folder
     393            if (@rename($old_folder_path, $new_folder_path)) {
     394                // Update WordPress option to reference new path
     395                $plugin_slug = $desired_folder . '/' . $plugin_main_file;
    390396
    391397                if ($was_active) {
    392                     deactivate_plugins($result['destination_name'] . '/' . $plugin_main_file);
     398                    activate_plugin($plugin_slug);
    393399                }
    394400
    395                 // Rename the folder
    396                 if (@rename($old_folder_path, $new_folder_path)) {
    397                     // Update WordPress option to reference new path
    398                     $plugin_slug = $desired_folder . '/' . $plugin_main_file;
    399 
    400                     if ($was_active) {
    401                         activate_plugin($plugin_slug);
    402                     }
    403 
    404                     $result['destination']      = $new_folder_path;
    405                     $result['destination_name'] = $desired_folder; 
    406                 } else {
    407                         error_log("Failed to rename plugin folder.");
    408                 }
     401                $result['destination']      = $new_folder_path;
     402                $result['destination_name'] = $desired_folder; 
     403            } else {
     404                error_log("Failed to rename plugin folder.");
    409405            }
    410406        }
  • loan-calculator-wp/trunk/readme.txt

    r3292676 r3324153  
    1010Requires PHP:      7.4
    1111Tested up to:      6.8
    12 Stable tag:        2.0.1
     12Stable tag:        2.0.2
    1313License:           GPLv2 or later
    1414License URI:       https://www.gnu.org/licenses/gpl-2.0.html
    15 Version:           2.0.1
     15Version:           2.0.2
    1616
    1717Loan / EMI Calculator for Home Loan and Personal Loan
     
    129129== Changelog ==
    130130
     131= 2.0.2 (July 8, 2025) =
     132* Fixed activation issue with the Pro plugin
     133
    131134= 2.0.1 (May 13, 2025) =
    132135* Resolved graph issue.
Note: See TracChangeset for help on using the changeset viewer.