🔒 EXCLUSIVE: Changeset/ - Collection

Changeset 3327802


Ignore:
Timestamp:
07/14/2025 08:19:56 PM (6 months ago)
Author:
blobaugh
Message:

v2.4.6.2

Location:
simple-feature-requests/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • simple-feature-requests/trunk/inc/class-admin-filters.php

    r3128855 r3327802  
    1616        add_action( 'admin_head', array(__CLASS__, 'admin_head_date_range') );
    1717        add_filter( 'months_dropdown_results', array(__CLASS__, 'months_dropdown_remove_it') );
     18        add_filter( 'pre_get_posts', array(__CLASS__, 'parse_admin_query_user') );
    1819    }
    1920
     
    2627        }
    2728        self::add_admin_filter_status( $post_type );
     29        self::add_admin_filter_user( $post_type );
    2830        echo '<span class="sfr-admin-filters-date">';
    2931        self::add_admin_filter_date_range( $post_type );
     
    6466        $status = filter_input( INPUT_GET, 'status', FILTER_SANITIZE_SPECIAL_CHARS );
    6567        // Maybe filter by request status
    66         if ( !empty( $status ) && 0 != $status ) {
     68        if ( !empty( $status ) ) {
    6769            $meta_query = (array) $query->get( 'meta_query' );
    6870            $meta_query[] = array(
     
    105107
    106108    /**
    107      * Render the filter to the admin Requests page for the date picker 
     109     * Render the filter to the admin Requests page for the date picker
    108110     *
    109111     * @param string $post_type
     
    131133    public static function admin_head_date_range() {
    132134        ?>
    133         <script>
    134             document.addEventListener('DOMContentLoaded', function() {
    135                 jQuery('.request-datepicker').datepicker({
    136                     dateFormat: 'yy-mm-dd'
    137                 });
    138             });
    139         </script>
    140 
    141         <style>
    142             .tablenav .actions {
    143                 width: 100% !important;
    144             }
    145 
    146             .sfr-admin-filters {
    147                 margin: 10px 25px;
    148                 padding: 25px;
    149                 background-color: #fefefe;
    150                 border: 1px solid #333;
    151                 border-radius: 5px;
    152 
    153             }
    154 
    155             .sfr-admin-filters-date {
    156                 border: 1px solid #333;
    157                 border-radius: 5px;
    158                 padding: 10px;
    159                 background-color: #f9f9f9;
    160             }
    161 
    162             .sfr-filter-full-width {
    163                 width: 100vh;
    164             }
    165 
    166             #post-query-submit {
    167                 margin-bottom: 10px;
    168             }
    169 
    170             .ui-datepicker {
    171                 background: #fefefe;
    172                 border: 1px solid #ca3656;
    173             }
    174 
    175             .ui-datepicker-header {
    176                 background-color: #ca3656 !important;
    177                 border: none;
    178                 color: #333;
    179                 font-weight: bold;
    180                 text-align: center;
    181                 padding-top: 10px;
    182             }
    183 
    184             .ui-datepicker-header a {
    185                 color: #f2f2f2;
    186             }
    187 
    188             .ui-datepicker-header .ui-corner-all {
    189                 padding-left: 5px;
    190                 padding-right: 5px;
    191             }
    192 
    193             .ui-datepicker-title {
    194                 color: #f2f2f2;
    195                 align: center;
    196                 text-align: center;
    197                 padding: 10px;
    198             }
    199 
    200             .ui-datepicker-calendar .ui-state-active {
    201                 background-color: #337ab7;
    202                 color: #fff;
    203             }
    204 
    205             .ui-datepicker-week-end {
    206                 color: red;
    207             }
    208 
    209             .ui-datepicker-calendar tbody td:hover {
    210                 background-color: #f5f5f5;
    211                 cursor: pointer;
    212             }
    213         </style>
    214 <?php
     135        <script>
     136            document.addEventListener('DOMContentLoaded', function() {
     137                jQuery('.request-datepicker').datepicker({
     138                    dateFormat: 'yy-mm-dd'
     139                });
     140            });
     141        </script>
     142
     143        <style>
     144       
     145.tablenav .actions {
     146    width: 100% !important;
     147}
     148
     149.sfr-admin-filters {
     150    margin: 20px 0;
     151    padding: 24px;
     152    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
     153    border: 1px solid #e1e5e9;
     154    border-radius: 12px;
     155    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
     156    position: relative;
     157    overflow: hidden;
     158}
     159
     160.sfr-admin-filters::before {
     161    content: '';
     162    position: absolute;
     163    top: 0;
     164    left: 0;
     165    right: 0;
     166    height: 3px;
     167    background: linear-gradient(90deg, #ca3656 0%, #cccccc 100%);
     168}
     169
     170.sfr-admin-filters h2 {
     171    margin: 0 0 20px 0;
     172    padding: 0;
     173    font-size: 18px;
     174    font-weight: 600;
     175    color: #2c3e50;
     176    display: flex;
     177    align-items: center;
     178    gap: 8px;
     179}
     180
     181.sfr-admin-filters h2::before {
     182    content: '🔍';
     183    font-size: 16px;
     184}
     185
     186.sfr-admin-filters select {
     187    appearance: none;
     188    background: white;
     189    border: 2px solid #e1e5e9;
     190    border-radius: 8px;
     191    padding: 10px 40px 10px 12px;
     192    font-size: 14px;
     193    font-weight: 500;
     194    color: #2c3e50;
     195    cursor: pointer;
     196    transition: all 0.2s ease;
     197    margin-right: 12px;
     198    min-width: 140px;
     199    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
     200    background-position: right 12px center;
     201    background-repeat: no-repeat;
     202    background-size: 16px;
     203}
     204
     205.sfr-admin-filters select:hover {
     206    border-color: #ca3656;
     207    box-shadow: 0 0 0 3px rgba(202, 54, 86, 0.1);
     208}
     209
     210.sfr-admin-filters select:focus {
     211    outline: none;
     212    border-color: #ca3656;
     213    box-shadow: 0 0 0 3px rgba(202, 54, 86, 0.2);
     214}
     215
     216.sfr-admin-filters-date {
     217    display: inline-flex;
     218    align-items: center;
     219    gap: 12px;
     220    background: white;
     221    border: 2px solid #e1e5e9;
     222    border-radius: 8px;
     223    padding: 8px 16px;
     224    margin-left: 12px;
     225    transition: all 0.2s ease;
     226}
     227
     228.sfr-admin-filters-date:hover {
     229    border-color: #ca3656;
     230    box-shadow: 0 0 0 3px rgba(202, 54, 86, 0.1);
     231}
     232
     233.sfr-admin-filters-date strong {
     234    font-weight: 600;
     235    color: #4a5568;
     236    font-size: 14px;
     237    white-space: nowrap;
     238}
     239
     240.request-datepicker {
     241    appearance: none;
     242    background: #f7f8fc;
     243    border: 1px solid #e2e8f0;
     244    border-radius: 6px;
     245    padding: 8px 12px;
     246    font-size: 14px;
     247    color: #2d3748;
     248    transition: all 0.2s ease;
     249    width: 120px;
     250}
     251
     252.request-datepicker:focus {
     253    outline: none;
     254    background: white;
     255    border-color: #ca3656;
     256    box-shadow: 0 0 0 2px rgba(202, 54, 86, 0.2);
     257}
     258
     259.request-datepicker::placeholder {
     260    color: #a0aec0;
     261    font-style: italic;
     262}
     263
     264#post-query-submit {
     265    background: linear-gradient(135deg, #ca3656 0%, #a82d4a 100%);
     266    color: white;
     267    border: none;
     268    border-radius: 8px;
     269    padding: 12px 24px;
     270    font-size: 14px;
     271    font-weight: 600;
     272    cursor: pointer;
     273    transition: all 0.2s ease;
     274    margin: 16px 0 0 0;
     275    box-shadow: 0 2px 4px rgba(202, 54, 86, 0.2);
     276}
     277
     278#post-query-submit:hover {
     279    transform: translateY(-1px);
     280    box-shadow: 0 4px 8px rgba(202, 54, 86, 0.3);
     281}
     282
     283#post-query-submit:active {
     284    transform: translateY(0);
     285}
     286
     287/* Enhanced Datepicker Styles */
     288.ui-datepicker {
     289    background: white;
     290    border: none;
     291    border-radius: 12px;
     292    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
     293    padding: 0;
     294    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
     295    overflow: hidden;
     296}
     297
     298.ui-datepicker-header {
     299    background: linear-gradient(135deg, #ca3656 0%, #a82d4a 100%) !important;
     300    border: none !important;
     301    color: white !important;
     302    font-weight: 600 !important;
     303    text-align: center !important;
     304    padding: 16px 10px !important;
     305    position: relative;
     306}
     307
     308.ui-datepicker-header a {
     309    color: white !important;
     310    text-decoration: none !important;
     311    opacity: 0.8 !important;
     312    transition: opacity 0.2s ease !important;
     313}
     314
     315.ui-datepicker-header a:hover {
     316    opacity: 1 !important;
     317}
     318
     319.ui-datepicker-header .ui-corner-all {
     320    padding: 4px 8px !important;
     321    border-radius: 4px !important;
     322    background: rgba(255, 255, 255, 0.1) !important;
     323}
     324
     325.ui-datepicker-title {
     326    color: white !important;
     327    text-align: center !important;
     328    padding: 0 !important;
     329    font-size: 16px !important;
     330    font-weight: 600 !important;
     331}
     332
     333.ui-datepicker-calendar {
     334    margin: 0 !important;
     335    border-collapse: collapse !important;
     336    width: 100% !important;
     337}
     338
     339.ui-datepicker-calendar th {
     340    background: #f8f9fa !important;
     341    color: #6c757d !important;
     342    font-weight: 600 !important;
     343    padding: 12px 8px !important;
     344    text-align: center !important;
     345    border: none !important;
     346    font-size: 12px !important;
     347    text-transform: uppercase !important;
     348    letter-spacing: 0.5px !important;
     349}
     350
     351.ui-datepicker-calendar td {
     352    border: none !important;
     353    padding: 2px !important;
     354}
     355
     356.ui-datepicker-calendar td a {
     357    display: block !important;
     358    padding: 10px !important;
     359    text-align: center !important;
     360    text-decoration: none !important;
     361    color: #2d3748 !important;
     362    font-weight: 500 !important;
     363    border-radius: 6px !important;
     364    margin: 2px !important;
     365    transition: all 0.2s ease !important;
     366}
     367
     368.ui-datepicker-calendar td a:hover {
     369    background: #e2e8f0 !important;
     370    color: #2d3748 !important;
     371}
     372
     373.ui-datepicker-calendar .ui-state-active {
     374    background: linear-gradient(135deg, #ca3656 0%, #a82d4a 100%) !important;
     375    color: white !important;
     376}
     377
     378.ui-datepicker-calendar .ui-state-active:hover {
     379    background: linear-gradient(135deg, #b8324f 0%, #962943 100%) !important;
     380    color: white !important;
     381}
     382
     383.ui-datepicker-week-end a {
     384    color: #e53e3e !important;
     385}
     386
     387.ui-datepicker-other-month a {
     388    color: #a0aec0 !important;
     389}
     390
     391/* Responsive adjustments */
     392@media (max-width: 768px) {
     393    .sfr-admin-filters {
     394        margin: 10px 0;
     395        padding: 16px;
     396    }
     397   
     398    .sfr-admin-filters select {
     399        margin-right: 8px;
     400        margin-bottom: 8px;
     401        min-width: 120px;
     402    }
     403   
     404    .sfr-admin-filters-date {
     405        margin-left: 0;
     406        margin-top: 8px;
     407        flex-wrap: wrap;
     408    }
     409   
     410    .request-datepicker {
     411        width: 100px;
     412    }
     413}
     414        </style>
     415        <?php
    215416    }
    216417
     
    219420    }
    220421
    221 }
     422    /**
     423     * Render the filter to the admin Requests page for request User
     424     *
     425     * @param string $post_type
     426     * @return void
     427     */
     428    public static function add_admin_filter_user( $post_type ) {
     429        global $wpdb;
     430        $selected_user = filter_input( INPUT_GET, 'user_id', FILTER_SANITIZE_NUMBER_INT );
     431        // Get users who have created feature requests
     432        $users = $wpdb->get_results( $wpdb->prepare( "SELECT DISTINCT p.post_author, u.display_name, u.user_login\n            FROM {$wpdb->posts} p\n            LEFT JOIN {$wpdb->users} u ON u.ID = p.post_author\n            WHERE p.post_type = '%s'\n            AND p.post_status != 'trash'\n            ORDER BY u.display_name", 'cpt_feature_requests' ) );
     433        echo '<select id="user_id" name="user_id">';
     434        echo '<option value="0">' . __( 'Show all Users', 'simple-feature-requests' ) . '</option>';
     435        foreach ( $users as $user ) {
     436            $user_display = ( !empty( $user->display_name ) ? $user->display_name : $user->user_login );
     437            echo '<option value="' . $user->post_author . '"' . selected( $user->post_author, $selected_user ) . '>' . $user_display . '</option>';
     438        }
     439        echo '</select>';
     440    }
     441
     442    /**
     443     * Filter the admin Requests page query and add the User filter.
     444     *
     445     * @param WP_Query $query
     446     * @return void
     447     */
     448    public static function parse_admin_query_user( $query ) {
     449        // Make sure we are on the feature requests admin page
     450        if ( !$query->is_main_query() || 'cpt_feature_requests' !== $query->query['post_type'] ) {
     451            return $query;
     452        }
     453        $user_id = filter_input( INPUT_GET, 'user_id', FILTER_SANITIZE_NUMBER_INT );
     454        // Maybe filter by user
     455        if ( !empty( $user_id ) && 0 != $user_id ) {
     456            $query->set( 'author', $user_id );
     457        }
     458        return $query;
     459    }
     460
     461}
  • simple-feature-requests/trunk/plugin-data.json

    r3325844 r3327802  
    11{
    2   "version": "2.4.6.1",
     2  "version": "2.4.6.2",
    33  "wp": "6.8.1",
    44  "wp_requires": "6.0",
  • simple-feature-requests/trunk/readme.txt

    r3325844 r3327802  
    55Requires at least: 6.0
    66Tested up to: 6.8.1
    7 Stable tag: 2.4.6.1
     7Stable tag: 2.4.6.2
    88Requires PHP: 7.4
    99License: GPLv2 or later
     
    130130
    131131== Changelog ==
     132**v2.4.6.2 (2025-07-14)**
     133Enhancement: Added admin filter by author to the request list page
     134Enhancement: Refreshed and beautified the admin filter styling
     135Bugfix: Fixed a PHP error some user received that fatal error on SFR\App. Props @dimdim2001
     136
    132137**v2.4.6.1 (2025-07-10)***
    133138Enhancement: Updated Freemius SDK to 2.12.1
  • simple-feature-requests/trunk/simple-feature-requests.php

    r3325844 r3327802  
    55 * Plugin URI: https://simplefeaturerequests.com
    66 * Description: Collect and manage user feedback using your existing WordPress website. Prioritize the product features important to you and your customers.
    7  * Version: 2.4.6.1
     7 * Version: 2.4.6.2
    88 * Author: Mindsize
    99 * Author URI: https://mindsize.com
     
    2222     * @var string
    2323     */
    24     public static $version = '2.4.6.1';
     24    public static $version = '2.4.6.2';
    2525
    2626    /**
Note: See TracChangeset for help on using the changeset viewer.