Plugin Directory

Changeset 3231149


Ignore:
Timestamp:
01/29/2025 09:20:35 AM (14 months ago)
Author:
globaliser
Message:

Globaliser 0.9.6 Version

Location:
globaliser
Files:
86 added
8 edited

Legend:

Unmodified
Added
Removed
  • globaliser/trunk/app/models/authors-model.php

    r3209200 r3231149  
    1818            " WHERE p.post_type = 'post' AND p.post_status = 'publish' " .
    1919            " GROUP BY u.ID ";
    20         return $this->db->get_results($query);
     20        $data = $this->db->get_results($query);
     21        $this->check_error();
     22        return $data;
    2123    }
    2224
     
    2830            " GROUP BY u.ID ";
    2931        $query = $this->db->prepare($query, [$author]);
    30         return $this->db->get_results($query);
     32        $data = $this->db->get_results($query);
     33        $this->check_error();
     34        return $data;
    3135    }
    3236}
  • globaliser/trunk/app/models/general-model.php

    r3209200 r3231149  
    1616        $query = "DELETE FROM %s";
    1717        $query = $this->db->prepare($query, [$this->table]);
    18         $this->db->query($query);
     18        $data = $this->db->query($query);
     19        $this->check_error();
     20        return $data;
    1921    }
    2022}
  • globaliser/trunk/app/models/hooks-model.php

    r3209200 r3231149  
    1616        $query = "SELECT * FROM " . $this->table .
    1717            " WHERE status=" . 1;
    18         return $this->db->get_results($query);
     18        $data = $this->db->get_results($query);
     19        $this->check_error();
     20        return $data;
    1921    }
    2022
    2123    function update_hook_status($id, $status)
    2224    {
    23         return $this->db->update(
     25        $data = $this->db->update(
    2426            $this->table,
    2527            array('status' => $status, 'update_date' => current_time('mysql')),
     
    2830            array('%s')
    2931        );
     32        $this->check_error();
     33        return $data;
    3034    }
    3135
    3236    function add_hook($type, $parameter)
    3337    {
    34         $this->db->insert(
     38        $data = $this->db->insert(
    3539            $this->table,
    3640            [
     
    4246            array('%s', '%s', '%s', '%d', '%d')
    4347        );
     48        $this->check_error();
     49        return $data;
    4450    }
    4551}
  • globaliser/trunk/app/services/globaliser-service.php

    r3230681 r3231149  
    2424            id INT UNSIGNED NOT NULL AUTO_INCREMENT,
    2525            type VARCHAR(255) NOT NULL,
    26             parameter TEXT,
     26            parameter MEDIUMTEXT,
    2727            create_date DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
    2828            update_date DATETIME,
  • globaliser/trunk/constants/hooks-settings.php

    r3230681 r3231149  
    77    ['wp_update_nav_menu'],
    88    ['create_category', 'create_post_tag', 'activated_plugin', 'deactivated_plugin', 'upgrader_process_complete'],
    9     ['save_post', 'post_updated', 'transition_post_status', 'transition_comment_status', 'wp_insert_comment', 'wp_trash_post', 'delete_attachment', 'edited_category', 'edited_post_tag'],
     9    ['post_updated', 'transition_post_status', 'transition_comment_status', 'wp_insert_comment', 'wp_trash_post', 'delete_attachment', 'edited_category', 'edited_post_tag'],
    1010    ['delete_category', 'delete_post_tag'],
    1111    ['wp_save_image_editor_file', 'wp_handle_upload']
  • globaliser/trunk/globaliser.php

    r3230681 r3231149  
    44   Plugin URI: https://www.globaliser.com/wordpress-hosting/
    55   Description:  This plugin enables Globaliser Cloud Speed, Security, and Reliability features for WordPress sites. It is intended for Globaliser clients only.
    6    Version: 0.9.5
     6   Version: 0.9.6
    77   Author: Globaliser, Inc.
    88   Author URI: https://www.globaliser.com
  • globaliser/trunk/readme.txt

    r3230681 r3231149  
    55License: GPLv2 or later
    66Tested up to: 6.7.1
    7 Stable tag: 0.9.5
     7Stable tag: 0.9.6
    88Requires PHP: 8.1
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    2828== Changelog ==
    2929
     30= 0.9.6 =
     31* Bug fix for cache updates affected by some themes.
     32* Model error checks and logs added.
     33
    3034= 0.9.5 =
    3135* Clear Cache Option is Added
    32 * Fixed Creation of dynamic property PHP Deprecation Warning
     36* Fixed PHP Deprecation Warning for Creating Dynamic Property
    3337* Fixed Cache Update Bug for Pages
    3438
  • globaliser/trunk/vendor/ata/app/base/model.php

    r3202469 r3231149  
    9898    if ($table !== null) $this->table = $table;
    9999  }
     100
     101  protected function check_error($query = '')
     102  {
     103    if ($this->db->last_error) {
     104      // Get the backtrace information
     105      $backtrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);
     106      // Get the caller's function name (the method that called check_error)
     107      $caller = isset($backtrace[1]['function']) ? $backtrace[1]['function'] : 'Unknown Function';
     108
     109      // Log the error with the query and the caller information
     110      $log_message = "Database error: " . $this->db->last_error . "\n";
     111      if ($query) {
     112        $log_message .= "Failed Query: " . $query . "\n";
     113      }
     114      $log_message .= "Called from: " . $caller . " function\n";
     115      $log_message .= "Backtrace:\n" . print_r($backtrace, true);
     116
     117      // Log to the PHP error log
     118      error_log($log_message);
     119    }
     120  }
    100121}
Note: See TracChangeset for help on using the changeset viewer.