Plugin Directory

Changeset 1813677


Ignore:
Timestamp:
02/01/2018 06:03:22 PM (8 years ago)
Author:
n7studios
Message:

Adding version 3.5.2

Location:
comment-rating-field-plugin/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • comment-rating-field-plugin/trunk/comment-rating-field-plugin.php

    r1811133 r1813677  
    33* Plugin Name: Comment Rating Field Plugin
    44* Plugin URI: https://www.wpzinc.com/plugins/comment-rating-field-pro-plugin
    5 * Version: 3.5.1
     5* Version: 3.5.2
    66* Author: WP Zinc
    77* Author URI: https://www.wpzinc.com
     
    5757        $this->plugin->name             = 'comment-rating-field-plugin';
    5858        $this->plugin->displayName      = 'Comment Rating Field';
    59         $this->plugin->version          = '3.5.1';
    60         $this->plugin->buildDate        = '2018-01-29 18:00:00';
     59        $this->plugin->version          = '3.5.2';
     60        $this->plugin->buildDate        = '2018-02-01 18:00:00';
    6161        $this->plugin->requires         = 3.6;
    6262        $this->plugin->tested           = '4.9.2';
  • comment-rating-field-plugin/trunk/includes/admin/install.php

    r1811133 r1813677  
    4848                Comment_Rating_Field_Pro_Fields::get_instance()->activate();
    4949                Comment_Rating_Field_Pro_Groups::get_instance()->activate();
     50
     51                // If no Group exists, create a Group and Field now
     52                $total = Comment_Rating_Field_Pro_Groups::get_instance()->total();
     53                if ( ! $total ) {
     54                    // Create Group and Field
     55                    $result = Comment_Rating_Field_Pro_Install::get_instance()->create_group_and_field( array(
     56                        'type' => array(
     57                            'post' => 1,
     58                        ),
     59                    ) );
     60
     61                    // Bail if an error occured
     62                    if ( is_wp_error( $result ) ) {
     63                        wp_die( $result->get_error_message() );
     64                        return;
     65                    }
     66                }
     67
    5068                restore_current_blog();
    5169            }
     
    5472            Comment_Rating_Field_Pro_Fields::get_instance()->activate();
    5573            Comment_Rating_Field_Pro_Groups::get_instance()->activate();
     74
     75            // If no Group exists, create a Group and Field now
     76            $total = Comment_Rating_Field_Pro_Groups::get_instance()->total();
     77            if ( ! $total ) {
     78                // Create Group and Field
     79                $result = Comment_Rating_Field_Pro_Install::get_instance()->create_group_and_field( array(
     80                    'type' => array(
     81                        'post' => 1,
     82                    ),
     83                ) );
     84
     85                // Bail if an error occured
     86                if ( is_wp_error( $result ) ) {
     87                    wp_die( $result->get_error_message() );
     88                    return;
     89                }
     90            }
    5691        }
    5792
  • comment-rating-field-plugin/trunk/includes/global/fields.php

    r1811133 r1813677  
    3333
    3434    /**
    35     * Activation routines for this Model
    36     *
    37     * @since    3.2.0
    38     *
    39     * @global   $wpdb   WordPress DB Object
    40     */
     35     * Activation routines for this Model
     36     *
     37     * @since    3.2.0
     38     *
     39     * @global   $wpdb   WordPress DB Object
     40     */
    4141    public function activate() {
    4242
     
    4444
    4545        // Create database tables
    46         $wpdb->query("  CREATE TABLE IF NOT EXISTS " . $wpdb->prefix . "crfp_fields (
     46        $wpdb->query("  CREATE TABLE IF NOT EXISTS " . $wpdb->prefix . $this->table . " (
    4747                            `fieldID` int(10) NOT NULL AUTO_INCREMENT,
    4848                            `groupID` int(10) NOT NULL DEFAULT '0',
     
    5757                        DEFAULT CHARSET=" . $wpdb->charset . "
    5858                        AUTO_INCREMENT=1" );
     59
     60        if ( defined( 'WP_DEBUG' ) && WP_DEBUG && ! empty( $wpdb->last_error ) ) {
     61            $wpdb->print_error();
     62        }
    5963
    6064    }
     
    209213       
    210214        // Return count
    211         return $wpdb->get_var( $query );
     215        return (int) $wpdb->get_var( $query );
    212216
    213217    }
  • comment-rating-field-plugin/trunk/includes/global/groups.php

    r1811133 r1813677  
    109109
    110110        // Create database tables
    111         $wpdb->query("  CREATE TABLE IF NOT EXISTS " . $wpdb->prefix . "crfp_groups (
     111        $wpdb->query("  CREATE TABLE IF NOT EXISTS " . $wpdb->prefix . $this->table . " (
    112112                            `groupID` int(10) NOT NULL AUTO_INCREMENT,
    113113                            `name` varchar(200) NOT NULL,
     
    126126                        AUTO_INCREMENT=1");
    127127
     128        if ( defined( 'WP_DEBUG' ) && WP_DEBUG && ! empty( $wpdb->last_error ) ) {
     129            $wpdb->print_error();
     130        }
     131
    128132    }
    129133
     
    321325       
    322326        // Return count
    323         return $wpdb->get_var( $query );
     327        return (int) $wpdb->get_var( $query );
    324328
    325329    }
  • comment-rating-field-plugin/trunk/readme.txt

    r1811138 r1813677  
    6969
    7070== Changelog ==
     71
     72= 3.5.2 =
     73* Fix: Installation: Ensure a Group and Field exist, if none are defined
    7174
    7275= 3.5.1 =
Note: See TracChangeset for help on using the changeset viewer.