Plugin Directory

Changeset 3394336


Ignore:
Timestamp:
11/12/2025 12:55:32 PM (5 months ago)
Author:
PropertyHive
Message:

Update to version 2.1.13

Location:
propertyhive/trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • propertyhive/trunk/README.txt

    r3393246 r3394336  
    44Requires at least: 5.6
    55Tested up to: 6.8.3
    6 Stable tag: 2.1.12
     6Stable tag: 2.1.13
    77License: GPLv3
    88License URI: http://www.gnu.org/licenses/gpl-3.0.html
     
    182182
    183183== Changelog ==
     184
     185= 2.1.13 - 2025-11-12 =
     186* Created search page and assign to 'Search Results Page' setting by default upon installation. This is one of the main sticking points when using Property Hive for the first time.
     187* Flagged the search results page as 'Property Search Results' in the list of pages so it's clear which is being used
     188* Updated default maps provider to OpenStreetMaps upon installation. This ensures maps show by default and there is no warning shown to new users about missing Google API key
     189* Security enhancement surrounding merging contacts
     190* Security enhancement surrounding generating applicant lists
    184191
    185192= 2.1.12 - 2025-11-10 =
  • propertyhive/trunk/includes/admin/class-ph-admin-applicant-list.php

    r3292381 r3394336  
    3636
    3737        <input type="hidden" name="submitted_applicant_list" value="1">
     38        <?php wp_nonce_field( 'ph_applicant_export', 'ph_applicant_export_nonce' ); ?>
    3839
    3940        <div id="poststuff" class="propertyhive_meta_box">
     
    10601061    public function export()
    10611062    {
     1063        if ( !isset( $_POST['ph_applicant_export_nonce'] ) || ! check_admin_referer( 'ph_applicant_export', 'ph_applicant_export_nonce', false ) )
     1064        {
     1065            wp_die( esc_html__( 'Invalid request (nonce failure)', 'propertyhive' ), 403 );
     1066        }
     1067
     1068        if ( !current_user_can( 'manage_propertyhive' ) )
     1069        {
     1070            wp_die( esc_html__( 'Insufficient permissions', 'propertyhive' ), 403 );
     1071        }
     1072
    10621073        $filename = 'applicant-list-' . date("YmdHis") . '.csv';
    10631074
  • propertyhive/trunk/includes/admin/class-ph-admin-merge-contacts.php

    r3292381 r3394336  
    164164                            contact_ids :       '<?php echo esc_js(ph_clean($_GET['merge_ids'])); ?>',
    165165                            primary_contact_id: selected_primary,
     166                            nonce:              '<?php echo wp_create_nonce( 'propertyhive_merge_contact' ); ?>',
    166167                        };
    167168
  • propertyhive/trunk/includes/admin/post-types/class-ph-admin-cpt-property.php

    r3365891 r3394336  
    5454        add_filter( 'manage_edit-property_sortable_columns', array( $this, 'custom_columns_sort' ) );
    5555        add_filter( 'request', array( $this, 'custom_columns_orderby' ) );
     56        add_filter( 'display_post_states', array( $this, 'flag_search_results_page' ), 10, 2 );
    5657
    5758        // Sort link
     
    8283        // Call PH_Admin_CPT constructor
    8384        parent::__construct();
     85    }
     86
     87    public function flag_search_results_page( $post_states, $post )
     88    {
     89        // Get the page ID set in your option
     90        $search_results_page_id = get_option( 'propertyhive_search_results_page_id' );
     91
     92        // Check if this is that page
     93        if ( $post->ID == $search_results_page_id )
     94        {
     95            $post_states['property_search_results'] = __( 'Property Search Results', 'propertyhive' );
     96        }
     97
     98        return $post_states;
    8499    }
    85100
  • propertyhive/trunk/includes/class-ph-ajax.php

    r3365891 r3394336  
    27312731        $this->json_headers();
    27322732
    2733         if ( !isset( $_POST['contact_ids'] ) || !isset( $_POST['primary_contact_id'] ) )
     2733        if ( ! isset( $_POST['nonce'] ) || ! check_ajax_referer( 'propertyhive_merge_contact', 'nonce', false ) )
     2734        {
     2735            $return = array('error' => 'Invalid nonce');
     2736            echo json_encode( $return );
     2737            die();
     2738        }
     2739
     2740        if ( !isset( $_POST['contact_ids'] ) || empty( $_POST['contact_ids'] ) || !isset( $_POST['primary_contact_id'] ) || empty( $_POST['primary_contact_id'] ) )
    27342741        {
    27352742            $return = array('error' => 'Invalid parameters received');
     
    27382745        }
    27392746
    2740         $contacts_to_merge = explode('|', $_POST['contact_ids']);
    2741         $primary_contact_id = $_POST['primary_contact_id'];
     2747        $contacts_to_merge = array_filter( array_map( 'absint', explode( '|', $_POST['contact_ids'] ) ) );
     2748
     2749        $primary_contact_id = absint( wp_unslash( $_POST['primary_contact_id'] ) );
    27422750
    27432751        if ( !is_array($contacts_to_merge) || !in_array( $primary_contact_id, $contacts_to_merge )  )
     
    27482756        }
    27492757
     2758        if ( get_post_type( $primary_contact_id ) !== 'contact' )
     2759        {
     2760            $return = array('error' => 'Primary contact ' . $primary_contact_id . ' is not a contact');
     2761            echo json_encode( $return );
     2762            die();
     2763        }
     2764
     2765        if ( !current_user_can( 'edit_post', $primary_contact_id ) )
     2766        {
     2767            $return = array('error' => 'Insufficient permissions for primary contact');
     2768            echo json_encode( $return );
     2769            die();
     2770        }
     2771
    27502772        // Check each post ID passed through is in fact of post type 'contact'
    27512773        foreach ( $contacts_to_merge as $child_contact_id )
    27522774        {
    2753             if ( get_post_type((int)$child_contact_id) != 'contact' )
    2754             {
    2755                 $return = array('error' => 'Contact ID ' . $child_contact_id . ' received which is not a contact');
     2775            if ( get_post_type((int)$child_contact_id) !== 'contact' )
     2776            {
     2777                $return = array('error' => 'Contact ID ' . $child_contact_id . ' is not a contact');
     2778                echo json_encode( $return );
     2779                die();
     2780            }
     2781
     2782            if ( !current_user_can( 'edit_post', $child_contact_id ) )
     2783            {
     2784                $return = array('error' => 'Insufficient permissions for contact ID ' . $child_contact_id );
    27562785                echo json_encode( $return );
    27572786                die();
  • propertyhive/trunk/includes/class-ph-install.php

    r3318353 r3394336  
    9797        {
    9898            $this->create_terms();
     99            $this->create_pages();
    99100            set_transient( '_ph_activation_redirect', 1, 30 );
    100101        }
     
    213214     * @return void
    214215     */
    215     public static function create_pages() {
     216    public function create_pages() {
    216217
    217218        // Create page object
     
    226227       
    227228        // Insert the post into the database
    228         $page_id = wp_insert_post( $my_post );
     229        $page_id = wp_insert_post( $my_post, true );
    229230       
    230         update_option( 'propertyhive_search_results_page_id', $page_id );
     231        if ( !is_wp_error($page_id) )
     232        {
     233            update_option( 'propertyhive_search_results_page_id', $page_id );
     234        }
    231235    }
    232236
     
    624628        add_option( 'propertyhive_primary_department', 'residential-sales', '',  'yes' );
    625629
     630        add_option( 'propertyhive_maps_provider', 'osm', '', 'no' );
     631        add_option( 'propertyhive_geocoding_provider', 'osm', '', 'no' );
     632
    626633        add_option( 'propertyhive_default_country', 'GB', '', 'yes' );
    627634        add_option( 'propertyhive_countries', array('GB'), '', 'yes' );
  • propertyhive/trunk/propertyhive.php

    r3393246 r3394336  
    44 * Plugin URI: https://wordpress.org/plugins/propertyhive/
    55 * Description: Property Hive has everything you need to build estate agency websites
    6  * Version: 2.1.12
     6 * Version: 2.1.13
    77 * Author: PropertyHive
    88 * Author URI: https://wp-property-hive.com
     
    2828    *
    2929    * @class PropertyHive
    30     * @version 2.1.12
     30    * @version 2.1.13
    3131    */
    3232    final class PropertyHive {
     
    3535         * @var string
    3636         */
    37         public $version = '2.1.12';
     37        public $version = '2.1.13';
    3838         
    3939        /**
Note: See TracChangeset for help on using the changeset viewer.