Plugin Directory

Changeset 1190876


Ignore:
Timestamp:
07/01/2015 04:02:27 PM (11 years ago)
Author:
krozero199
Message:

fixed database bug from 1.1.0 and 1.1.1

Location:
wp-custom-widget-area/trunk
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • wp-custom-widget-area/trunk/README.txt

    r1190757 r1190876  
    44Requires at least: 3.0.1
    55Tested up to: 4.2.2
    6 Stable tag: 1.1.1
     6Stable tag: 1.1.2
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    7373== Changelog ==
    7474
     75= 1.1.2 =
     76* database bug fix for v 1.1.0 and 1.1.1
     77
    7578= 1.1.1 =
    7679* database update fix for v 1.1.0
     
    101104== Upgrade Notice ==
    102105
     106= 1.1.2 =
     107* database bug fix for v 1.1.0 and 1.1.1
     108
    103109= 1.1.1 =
    104110* database update fix for v 1.1.0
  • wp-custom-widget-area/trunk/admin/class-wp-custom-widget-area-admin.php

    r1190756 r1190876  
    55 *
    66 * @link       http://example.com
    7  * @since      1.1.1
     7 * @since      1.1.2
    88 *
    99 * @package    Custom_Widget_Area
     
    2929     * The ID of this plugin.
    3030     *
    31      * @since    1.1.1
     31     * @since    1.1.2
    3232     * @access   private
    3333     * @var      string    $plugin_name    The ID of this plugin.
     
    3838     * The version of this plugin.
    3939     *
    40      * @since    1.1.1
     40     * @since    1.1.2
    4141     * @access   private
    4242     * @var      string    $version    The current version of this plugin.
     
    4747     * Initialize the class and set its properties.
    4848     *
    49      * @since    1.1.1
     49     * @since    1.1.2
    5050     * @var      string    $plugin_name       The name of this plugin.
    5151     * @var      string    $version    The version of this plugin.
     
    356356     * Register the stylesheets for the Dashboard.
    357357     *
    358      * @since    1.1.1
     358     * @since    1.1.2
    359359     */
    360360    public function enqueue_styles() {
     
    379379     * Register the JavaScript for the dashboard.
    380380     *
    381      * @since    1.1.1
     381     * @since    1.1.2
    382382     */
    383383    public function enqueue_scripts() {
  • wp-custom-widget-area/trunk/admin/partials/cwa-admin-display.php

    r1190756 r1190876  
    77 *
    88 * @link       http://example.com
    9  * @since      1.1.1
     9 * @since      1.1.2
    1010 *
    1111 * @package    Custom_Widget_Area
  • wp-custom-widget-area/trunk/admin/partials/cwa-menu-admin-display.php

    r1190756 r1190876  
    77 *
    88 * @link       http://example.com
    9  * @since      1.1.1
     9 * @since      1.1.2
    1010 *
    1111 * @package    Custom_Widget_Area
  • wp-custom-widget-area/trunk/includes/class-custom-widget-area.php

    r1190756 r1190876  
    88 *
    99 * @link       http://example.com
    10  * @since      1.1.1
     10 * @since      1.1.2
    1111 *
    1212 * @package    Custom_Widget_Area
     
    2323 * version of the plugin.
    2424 *
    25  * @since      1.1.1
     25 * @since      1.1.2
    2626 * @package    Custom_Widget_Area
    2727 * @subpackage Custom_Widget_Area/includes
     
    3434     * the plugin.
    3535     *
    36      * @since    1.1.1
     36     * @since    1.1.2
    3737     * @access   protected
    3838     * @var      Custom_Widget_Area_Loader    $loader    Maintains and registers all hooks for the plugin.
     
    4343     * The unique identifier of this plugin.
    4444     *
    45      * @since    1.1.1
     45     * @since    1.1.2
    4646     * @access   protected
    4747     * @var      string    $plugin_name    The string used to uniquely identify this plugin.
     
    5252     * The current version of the plugin.
    5353     *
    54      * @since    1.1.1
     54     * @since    1.1.2
    5555     * @access   protected
    5656     * @var      string    $version    The current version of the plugin.
     
    6565     * the public-facing side of the site.
    6666     *
    67      * @since    1.1.1
     67     * @since    1.1.2
    6868     */
    6969    public function __construct() {
    7070
    7171        $this->plugin_name = 'wp-custom-widget-area';
    72         $this->version = '1.1.1';
     72        $this->version = '1.1.2';
    7373
    7474        $this->load_dependencies();
     
    9292     * with WordPress.
    9393     *
    94      * @since    1.1.1
     94     * @since    1.1.2
    9595     * @access   private
    9696     */
     
    126126     * with WordPress.
    127127     *
    128      * @since    1.1.1
     128     * @since    1.1.2
    129129     * @access   private
    130130     */
     
    142142     * of the plugin.
    143143     *
    144      * @since    1.1.1
     144     * @since    1.1.2
    145145     * @access   private
    146146     */
     
    189189     * Run the loader to execute all of the hooks with WordPress.
    190190     *
    191      * @since    1.1.1
     191     * @since    1.1.2
    192192     */
    193193    public function run() {
     
    199199     * WordPress and to define internationalization functionality.
    200200     *
    201      * @since     1.1.1
     201     * @since     1.1.2
    202202     * @return    string    The name of the plugin.
    203203     */
     
    209209     * The reference to the class that orchestrates the hooks with the plugin.
    210210     *
    211      * @since     1.1.1
     211     * @since     1.1.2
    212212     * @return    Custom_Widget_Area_Loader    Orchestrates the hooks of the plugin.
    213213     */
     
    219219     * Retrieve the version number of the plugin.
    220220     *
    221      * @since     1.1.1
     221     * @since     1.1.2
    222222     * @return    string    The version number of the plugin.
    223223     */
  • wp-custom-widget-area/trunk/includes/class-wp-custom-widget-area-activator.php

    r1190756 r1190876  
    55 *
    66 * @link       http://example.com
    7  * @since      1.1.1
     7 * @since      1.1.2
    88 *
    99 * @package    Custom_Widget_Area
     
    1616 * This class defines all code necessary to run during the plugin's activation.
    1717 *
    18  * @since      1.1.1
     18 * @since      1.1.2
    1919 * @package    Custom_Widget_Area
    2020 * @subpackage Custom_Widget_Area/includes
     
    2828     * Long Description.
    2929     *
    30      * @since    1.1.1
     30     * @since    1.1.2
    3131     */
    3232    public static function activate() {
     
    3737
    3838    private function install_db(){
    39         global $wpdb;
    40         $kz_db_version = '1.0';
    41         $table_name = $wpdb->prefix . 'cwa';
    42         $charset_collate = '';
     39        global $wpdb, $kz_db_version, $table_name, $charset_collate;
    4340
    4441        if ( ! empty( $wpdb->charset ) ) {
     
    6764        dbDelta( $sql );
    6865
    69         add_option( 'kz_db_version', $kz_db_version );
     66        if ( get_option('kz_db_version') != $kz_db_version ) {
     67            update_option( 'kz_db_version', $kz_db_version );
     68        }else{
     69            add_option( 'kz_db_version', $kz_db_version );
     70        }
    7071    }
    7172
  • wp-custom-widget-area/trunk/includes/class-wp-custom-widget-area-deactivator.php

    r1190756 r1190876  
    55 *
    66 * @link       http://example.com
    7  * @since      1.1.1
     7 * @since      1.1.2
    88 *
    99 * @package    Custom_Widget_Area
     
    1616 * This class defines all code necessary to run during the plugin's deactivation.
    1717 *
    18  * @since      1.1.1
     18 * @since      1.1.2
    1919 * @package    Custom_Widget_Area
    2020 * @subpackage Custom_Widget_Area/includes
     
    2828     * Long Description.
    2929     *
    30      * @since    1.1.1
     30     * @since    1.1.2
    3131     */
    3232    public static function deactivate() {
  • wp-custom-widget-area/trunk/includes/class-wp-custom-widget-area-i18n.php

    r1190756 r1190876  
    88 *
    99 * @link       http://example.com
    10  * @since      1.1.1
     10 * @since      1.1.2
    1111 *
    1212 * @package    Custom_Widget_Area
     
    2020 * so that its ready for translation.
    2121 *
    22  * @since      1.1.1
     22 * @since      1.1.2
    2323 * @package    Custom_Widget_Area
    2424 * @subpackage Custom_Widget_Area/includes
     
    3030     * The domain specified for this plugin.
    3131     *
    32      * @since    1.1.1
     32     * @since    1.1.2
    3333     * @access   private
    3434     * @var      string    $domain    The domain identifier for this plugin.
     
    3939     * Load the plugin text domain for translation.
    4040     *
    41      * @since    1.1.1
     41     * @since    1.1.2
    4242     */
    4343    public function load_plugin_textdomain() {
     
    5454     * Set the domain equal to that of the specified domain.
    5555     *
    56      * @since    1.1.1
     56     * @since    1.1.2
    5757     * @param    string    $domain    The domain that represents the locale of this plugin.
    5858     */
  • wp-custom-widget-area/trunk/includes/class-wp-custom-widget-area-loader.php

    r1190756 r1190876  
    55 *
    66 * @link       http://example.com
    7  * @since      1.1.1
     7 * @since      1.1.2
    88 *
    99 * @package    Custom_Widget_Area
     
    2727     * The array of actions registered with WordPress.
    2828     *
    29      * @since    1.1.1
     29     * @since    1.1.2
    3030     * @access   protected
    3131     * @var      array    $actions    The actions registered with WordPress to fire when the plugin loads.
     
    3636     * The array of filters registered with WordPress.
    3737     *
    38      * @since    1.1.1
     38     * @since    1.1.2
    3939     * @access   protected
    4040     * @var      array    $filters    The filters registered with WordPress to fire when the plugin loads.
     
    4545     * Initialize the collections used to maintain the actions and filters.
    4646     *
    47      * @since    1.1.1
     47     * @since    1.1.2
    4848     */
    4949    public function __construct() {
     
    5757     * Add a new action to the collection to be registered with WordPress.
    5858     *
    59      * @since    1.1.1
     59     * @since    1.1.2
    6060     * @var      string               $hook             The name of the WordPress action that is being registered.
    6161     * @var      object               $component        A reference to the instance of the object on which the action is defined.
     
    7171     * Add a new filter to the collection to be registered with WordPress.
    7272     *
    73      * @since    1.1.1
     73     * @since    1.1.2
    7474     * @var      string               $hook             The name of the WordPress filter that is being registered.
    7575     * @var      object               $component        A reference to the instance of the object on which the filter is defined.
     
    8686     * collection.
    8787     *
    88      * @since    1.1.1
     88     * @since    1.1.2
    8989     * @access   private
    9090     * @var      array                $hooks            The collection of hooks that is being registered (that is, actions or filters).
     
    113113     * Register the filters and actions with WordPress.
    114114     *
    115      * @since    1.1.1
     115     * @since    1.1.2
    116116     */
    117117    public function run() {
  • wp-custom-widget-area/trunk/includes/config.php

    r1190756 r1190876  
    11<?php
    22/*plugin configs*/
    3 $kz_db_version = '1.1.1';
     3$kz_db_version = '1.1.2';
    44$table_name = $wpdb->prefix . 'cwa';
    55$charset_collate = '';
  • wp-custom-widget-area/trunk/uninstall.php

    r1190664 r1190876  
    2121 *
    2222 * @link       http://example.com
    23  * @since      1.1.0
     23 * @since      1.1.2
    2424 *
    2525 * @package    Custom_Widget_Area
  • wp-custom-widget-area/trunk/wp-custom-widget-area.php

    r1190756 r1190876  
    1717 * Plugin URI:        http://kishorkhambu.com.np/plugins/
    1818 * Description:       A wordpress plugin to create custom dynamic widget area.
    19  * Version:           1.1.1
     19 * Version:           1.1.2
    2020 * Author:            Kishor Khambu
    2121 * Author URI:        http://kishorkhambu.com.np
     
    6363 * not affect the page life cycle.
    6464 *
    65  * @since    1.1.1
     65 * @since    1.1.2
    6666 */
    6767function run_plugin_name() {
     
    7878
    7979// db fix for new version
    80 function db_update(){
     80/*function db_update(){
    8181    global $wpdb;
    8282    $table_name = 'wp_cwa';
    83     if(!!! $session_id)
     83    if( (phpversion() < 5.4 && !!! session_id()) || (phpversion() > 5.3 && !!!session_status() == PHP_SESSION_NONE))
    8484        session_start();
    8585
     
    101101}
    102102
    103 db_update();
     103db_update();*/
     104
     105
     106function myplugin_update_db_check() {
     107    global $kz_db_version, $wpdb, $table_name;
     108    if ( get_site_option( 'kz_db_version' ) != $kz_db_version ) {
     109        Custom_Widget_Area_Activator::activate();
     110       $x = $wpdb->query("ALTER TABLE $table_name ADD cwa_type varchar (10) ");
     111       $updaterow = $wpdb->get_results(  "SELECT id FROM $table_name");
     112       foreach ($updaterow as $data) {
     113            # code...
     114            $up = $wpdb->update($table_name, array('cwa_type'=> 'widget'), array('id'=>$data->id));
     115        }
     116    }
     117}
     118add_action( 'plugins_loaded', 'myplugin_update_db_check' );
     119
     120
Note: See TracChangeset for help on using the changeset viewer.