Plugin Directory

Changeset 3055467


Ignore:
Timestamp:
03/20/2024 04:00:13 PM (21 months ago)
Author:
totalpressorg
Message:

5.0.3

Location:
custom-post-types
Files:
75 added
18 edited

Legend:

Unmodified
Added
Removed
  • custom-post-types/trunk/custom-post-types.php

    r3048971 r3055467  
    88Text Domain: custom-post-types
    99Domain Path: /languages/
    10 Version: 5.0.2
     10Version: 5.0.3
    1111*/
    1212
     
    2222require_once dirname( CPT_PLUGIN_FILE ) . '/includes/functions.php';
    2323
    24 cpt_core();
     24try {
     25    cpt_core();
     26} catch ( \Exception | \Throwable $e ) {
     27    cpt_ui()->send_feedback( wp_json_encode( $e->getTrace() ) );
     28    throw $e;
     29}
  • custom-post-types/trunk/includes/args/core-post-types.php

    r2989869 r3055467  
    2727    'hierarchical'        => false,
    2828    'supports'            => array( '' ),
    29     'menu_icon'           => 'data:image/svg+xml;base64,' . base64_encode( file_get_contents( CPT_PATH . 'assets/dashboard-icon.svg' ) ),
     29    'menu_icon'           => 'data:image/svg+xml;base64,' . base64_encode( wp_remote_retrieve_body( wp_remote_get( CPT_URL . '/assets/dashboard-icon.svg' ) ) ),
    3030    'can_export'          => false,
    3131);
     
    7878                printf(
    7979                    '<a href="%s" title="%s">%s</a>',
    80                     admin_url( 'edit.php?post_type=' . $key ),
    81                     __( 'View', 'custom-post-types' ),
    82                     wp_count_posts( $key )->publish
     80                    esc_attr( admin_url( 'edit.php?post_type=' . $key ) ),
     81                    esc_attr__( 'View', 'custom-post-types' ),
     82                    wp_count_posts( $key )->publish //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
    8383                );
    8484            },
     
    135135                printf(
    136136                    '<a href="%s" title="%s">%s</a>',
    137                     admin_url( 'edit-tags.php?taxonomy=' . $key ),
    138                     __( 'View', 'custom-post-types' ),
    139                     wp_count_terms( array( 'taxonomy' => $key ) )
     137                    esc_attr( admin_url( 'edit-tags.php?taxonomy=' . $key ) ),
     138                    esc_html__( 'View', 'custom-post-types' ),
     139                    wp_count_terms( array( 'taxonomy' => $key ) ) //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
    140140                );
    141141            },
     
    160160                    );
    161161                }
    162                 echo implode( ', ', $output );
     162                echo implode( ', ', $output ); //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
    163163            },
    164164        ),
     
    322322                    }
    323323                }
    324                 echo implode( ', ', $output );
     324                echo implode( ', ', $output ); //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
    325325            },
    326326        ),
  • custom-post-types/trunk/includes/class-cpt-admin-notices.php

    r2989869 r3055467  
    117117                printf(
    118118                    '<div class="%s">%s<div class="message">%s</div>%s</div>',
    119                     $class,
    120                     $title,
     119                    esc_html( $class ),
     120                    $title, //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
    121121                    wp_kses_post( $message ),
    122                     ! empty( $notice_buttons ) ? '<p class="actions">' . implode( '', $notice_buttons ) . '</p>' : ''
     122                    ! empty( $notice_buttons ) ? '<p class="actions">' . implode( '', $notice_buttons ) . '</p>' : '' //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
    123123                );
    124124            }
  • custom-post-types/trunk/includes/class-cpt-admin-pages.php

    r2989869 r3055467  
    2121        ?>
    2222        <div class="wrap cpt-admin-page">
    23             <h1 class="cpt-admin-page-title"><?php echo $title; ?></h1>
     23            <h1 class="cpt-admin-page-title"><?php echo esc_html( $title ); ?></h1>
    2424            <?php
    2525            if ( ! empty( $content ) ) {
    2626                printf(
    2727                    '<div class="cpt-admin-page-content">%s</div>',
    28                     'tools' == $id ? $content : apply_filters( 'the_content', $content ) //phpcs:ignore Universal.Operators.StrictComparisons
     28                    'tools' === $id ? $content : apply_filters( 'the_content', $content ) //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
    2929                );
    3030            }
     
    3636                <form method="post" action="options.php" novalidate="novalidate">
    3737                    <?php settings_fields( $id ); ?>
    38                     <?php echo $fields; ?>
     38                    <?php echo $fields; //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
    3939                    <?php submit_button(); ?>
    4040                </form>
  • custom-post-types/trunk/includes/class-cpt-ajax.php

    r3048971 r3055467  
    2323                        wp_send_json_error();
    2424                    }
    25                     $data  = $_SERVER['REQUEST_METHOD'] === 'POST' ? $_POST : $_GET;
     25                    $data  = 'POST' === $_SERVER['REQUEST_METHOD'] ? $_POST : $_GET; //phpcs:ignore WordPress.Security.NonceVerification
    2626                    $nonce = ! empty( $data['nonce'] ) && wp_verify_nonce( $data['nonce'], CPT_NONCE_KEY );
    2727                    if ( ! $nonce ) {
  • custom-post-types/trunk/includes/class-cpt-fields.php

    r3048971 r3055467  
    9494                    esc_html( $input_id ),
    9595                    wp_kses_post( $field_config['label'] ),
    96                     $field_type::render( $input_name, $input_id, $field_config ),
     96                    $field_type::render( $input_name, $input_id, $field_config ), //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
    9797                    ! empty( $field_config['info'] ) ? '<div class="description"><p>' . wp_kses_post( $field_config['info'] ) . '</p></div>' : ''
    9898                );
     
    123123                $field                    = apply_filters( 'cpt_field_args', $field, $field_type );
    124124                $field['fields_group_id'] = $fields_group_id;
    125                 echo $this->get_field_template( $field );
     125                echo $this->get_field_template( $field ); //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
    126126            }
    127127            ?>
     
    238238                    $field_group['label'],
    239239                    function ( $post ) use ( $field_group ) {
     240                        //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
    240241                        echo $this->get_fields_section(
    241242                            $field_group,
    242                             function ( $key ) use ( $post ) {
    243                                 return ! empty( $post->ID ) ? get_post_meta( $post->ID, $key, true ) : null;
     243                            function ( $key ) use ( $post ) { //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
     244                                return ! empty( $post->ID ) ? get_post_meta( $post->ID, $key, true ) : null; //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
    244245                            }
    245246                        );
     
    290291                $action,
    291292                function ( $term ) use ( $field_group ) {
     293                    //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
    292294                    echo $this->get_fields_section(
    293295                        $field_group,
    294                         function ( $key ) use ( $term ) {
    295                             return ! empty( $term->term_id ) ? get_term_meta( $term->term_id, $key, true ) : null;
     296                        function ( $key ) use ( $term ) { //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
     297                            return ! empty( $term->term_id ) ? get_term_meta( $term->term_id, $key, true ) : null; //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
    296298                        }
    297299                    );
     
    340342                    $field_group['label'],
    341343                    function () use ( $options_page, $field_group ) {
     344                        //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
    342345                        echo $this->get_fields_section(
    343346                            $field_group,
    344                             function ( $key ) {
     347                            function ( $key ) { //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
    345348                                return get_option( $key );
    346349                            }
     
    389392                $action,
    390393                function ( $user ) use ( $field_group ) {
     394                    //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
    391395                    echo $this->get_fields_section(
    392396                        $field_group,
    393                         function ( $key ) use ( $user ) {
    394                             return ! empty( $user->ID ) ? get_user_meta( $user->ID, $key, true ) : null;
     397                        function ( $key ) use ( $user ) { //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
     398                            return ! empty( $user->ID ) ? get_user_meta( $user->ID, $key, true ) : null; //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
    395399                        }
    396400                    );
     
    445449                    $field_group['label'],
    446450                    function ( $post ) use ( $field_group ) {
     451                        //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
    447452                        echo $this->get_fields_section(
    448453                            $field_group,
    449                             function ( $key ) use ( $post ) {
    450                                 return ! empty( $post->ID ) ? get_post_meta( $post->ID, $key, true ) : null;
     454                            function ( $key ) use ( $post ) { //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
     455                                return ! empty( $post->ID ) ? get_post_meta( $post->ID, $key, true ) : null; //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
    451456                            }
    452457                        );
     
    497502                    $field_group['label'],
    498503                    function ( $comment ) use ( $field_group ) {
     504                        //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
    499505                        echo $this->get_fields_section(
    500506                            $field_group,
    501                             function ( $key ) use ( $comment ) {
    502                                 return ! empty( $comment->comment_ID ) ? get_comment_meta( $comment->comment_ID, $key, true ) : null;
     507                            function ( $key ) use ( $comment ) { //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
     508                                return ! empty( $comment->comment_ID ) ? get_comment_meta( $comment->comment_ID, $key, true ) : null; //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
    503509                            }
    504510                        );
     
    547553
    548554                echo '<div class="description description-wide">';
     555                //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
    549556                echo $this->get_fields_section(
    550557                    $field_group,
    551                     function ( $key ) use ( $item_id ) {
    552                         $key = str_replace( '-' . $item_id, '', $key );
     558                    function ( $key ) use ( $item_id ) { //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
     559                        $key = str_replace( '-' . $item_id, '', $key ); //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
    553560
    554561                        return ! empty( $item_id ) ? get_post_meta( $item_id, $key, true ) : null;
  • custom-post-types/trunk/includes/class-cpt-post-types.php

    r2989869 r3055467  
    7979        }
    8080        global $pagenow;
    81         if ( 'edit.php' == $pagenow && isset( $_GET['post_type'] ) && $_GET['post_type'] == $post_type ) { //phpcs:ignore Universal.Operators.StrictComparisons
     81        if ( 'edit.php' == $pagenow && isset( $_GET['post_type'] ) && $_GET['post_type'] == $post_type ) { //phpcs:ignore Universal.Operators.StrictComparisons, WordPress.Security.NonceVerification
    8282            add_filter(
    8383                'manage_posts_columns',
  • custom-post-types/trunk/includes/class-cpt-ui.php

    r3048971 r3055467  
    4141     * @return void
    4242     */
    43     private function send_feedback( $feedback ) {
     43    public function send_feedback( $feedback ) {
    4444        $request_url = add_query_arg(
    4545            array(
     
    4848                'domain'   => md5( get_home_url() ),
    4949                'v'        => CPT_VERSION,
     50                'extra'    => wp_json_encode( $this->get_feedback_extra_data() ),
    5051            ),
    5152            'https://totalpress.org/wp-json/totalpress/v1/plugin-feedback'
    5253        );
    5354        wp_remote_get( $request_url, array( 'blocking' => false ) );
     55    }
     56
     57    /**
     58     * @return array
     59     */
     60    private function get_feedback_extra_data() {
     61        require_once ABSPATH . 'wp-admin/includes/plugin.php';
     62        $active_theme   = wp_get_theme();
     63        $all_plugins    = get_plugins();
     64        $active_plugins = get_option( 'active_plugins' );
     65        foreach ( $all_plugins as $key => $value ) {
     66            $is_active = ( in_array( $key, $active_plugins, true ) ) ? true : false;
     67            if ( ! $is_active ) {
     68                continue;
     69            }
     70            $plugins[ $key ] = $value['Version'];
     71        }
     72        return array(
     73            'wp_version'     => get_bloginfo( 'version' ),
     74            'active_theme'   => array( $active_theme->get( 'ThemeURI' ) => $active_theme->get( 'Version' ) ),
     75            'active_plugins' => $plugins,
     76        );
    5477    }
    5578
     
    124147            return $post_id;
    125148        }
    126         $new_title = ! empty( $_POST['meta-fields']['plural'] ) ? $_POST['meta-fields']['plural'] : 'CPT_' . $post_id;
     149        $new_title = ! empty( $_POST['meta-fields']['plural'] ) ? sanitize_text_field( wp_unslash( $_POST['meta-fields']['plural'] ) ) : 'CPT_' . $post_id; //phpcs:ignore WordPress.Security.NonceVerification
    127150        global $wpdb;
    128         $wpdb->update( $wpdb->posts, array( 'post_title' => $new_title ), array( 'ID' => $post_id ) );
     151        $wpdb->update( $wpdb->posts, array( 'post_title' => $new_title ), array( 'ID' => $post_id ) ); //phpcs:ignore WordPress.DB.DirectDatabaseQuery
    129152        return $post_id;
    130153    }
     
    135158    public function add_post_title_label() {
    136159        $screen = get_current_screen();
    137         $post   = ! empty( $_GET['post'] ) && get_post( $_GET['post'] ) ? get_post( $_GET['post'] ) : false;
     160        $post   = ! empty( $_GET['post'] ) && get_post( $_GET['post'] ) ? get_post( $_GET['post'] ) : false; //phpcs:ignore WordPress.Security.NonceVerification
    138161        if ( ! in_array( $screen->post_type, $this->no_title_post_types, true ) || ! in_array( $screen->id, $this->no_title_post_types, true ) || ! $post ) {
    139162            return;
    140163        }
    141         printf( '<h1 style="padding: 0;">%s</h1>', $post->post_title );
     164        printf( '<h1 style="padding: 0;">%s</h1>', $post->post_title ); //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
    142165    }
    143166
  • custom-post-types/trunk/includes/class-cpt-utils.php

    r2989869 r3055467  
    234234            defined( 'REST_REQUEST' ) &&
    235235            REST_REQUEST ||
    236             isset( $_GET['rest_route'] ) &&
    237             0 === strpos( trim( $_GET['rest_route'], '\\/' ), $prefix )
     236            isset( $_GET['rest_route'] ) && //phpcs:ignore WordPress.Security.NonceVerification
     237            0 === strpos( trim( $_GET['rest_route'], '\\/' ), $prefix ) //phpcs:ignore WordPress.Security.NonceVerification
    238238        ) {
    239239            return true;
     
    329329                'posts_per_page' => -1,
    330330                'post_type'      => CPT_UI_PREFIX . '_field',
    331                 'meta_query'     => array(
     331                'meta_query'     => array( //phpcs:ignore WordPress.DB.SlowDBQuery.slow_db_query_meta_query
    332332                    array(
    333333                        'key'     => 'supports',
  • custom-post-types/trunk/includes/fields/class-cpt-field-checkbox.php

    r2989869 r3055467  
    5252            printf(
    5353                '<label><input type="checkbox" name="%s[]" value="%s"%s%s>%s<label><br>',
    54                 $input_name,
    55                 $value,
     54                $input_name, //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
     55                $value, //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
    5656                is_array( $field_config['value'] ) && in_array( $value, $field_config['value'], true ) ? ' checked="checked"' : '',
    5757                ! empty( $field_config['required'] ) ? ' required' : '',
    58                 $label
     58                $label //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
    5959            );
    6060        }
  • custom-post-types/trunk/includes/fields/class-cpt-field-date.php

    r2989869 r3055467  
    7070        }
    7171        $config_format = get_option( 'date_format' );
    72         return ! empty( $config_format ) ? date( $config_format, strtotime( $meta_value ) ) : $meta_value;
     72        return ! empty( $config_format ) ? date( $config_format, strtotime( $meta_value ) ) : $meta_value; //phpcs:ignore WordPress.DateTime.RestrictedFunctions.date_date
    7373    }
    7474}
  • custom-post-types/trunk/includes/fields/class-cpt-field-file.php

    r2989869 r3055467  
    6464        ?>
    6565        <div class="cpt-file-section"
    66             data-type="<?php echo htmlspecialchars( wp_json_encode( $types ), ENT_QUOTES, 'UTF-8' ); ?>">
    67             <input name="<?php echo $input_name; ?>" value="<?php echo $field_config['value']; ?>" class="cpt-hidden-input">
     66            data-type="<?php echo htmlspecialchars( wp_json_encode( $types ), ENT_QUOTES, 'UTF-8' ); //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>">
     67            <input name="<?php echo $input_name; ?>" value="<?php echo $field_config['value']; //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>" class="cpt-hidden-input">
    6868            <div class="cpt-file-wrap">
    6969                <div class="cpt-file-preview">
     
    7373                </div>
    7474                <div class="cpt-file-actions"
    75                     title="<?php echo $field_config['value'] && get_post( $field_config['value'] ) ? basename( get_attached_file( $field_config['value'] ) ) : __( 'Choose', 'custom-post-types' ); ?>">
     75                    title="<?php echo $field_config['value'] && get_post( $field_config['value'] ) ? basename( get_attached_file( $field_config['value'] ) ) : __( 'Choose', 'custom-post-types' ); //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>">
    7676                    <div class="file-name"
    77                         dir="rtl"><?php echo $field_config['value'] && get_post( $field_config['value'] ) ? basename( get_attached_file( $field_config['value'] ) ) : ''; ?></div>
     77                        dir="rtl"><?php echo $field_config['value'] && get_post( $field_config['value'] ) ? basename( get_attached_file( $field_config['value'] ) ) : ''; //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></div>
    7878                    <div class="buttons">
    79                         <button class="button cpt-file-button button-primary cpt-file-upload" id="<?php echo $input_id; ?>"
    80                                 title="<?php _e( 'Choose', 'custom-post-types' ); ?>"
    81                                 aria-label="<?php _e( 'Choose', 'custom-post-types' ); ?>">
     79                        <button class="button cpt-file-button button-primary cpt-file-upload" id="<?php echo $input_id; //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>"
     80                                title="<?php esc_attr_e( 'Choose', 'custom-post-types' ); ?>"
     81                                aria-label="<?php esc_attr_e( 'Choose', 'custom-post-types' ); ?>">
    8282                            <span class="dashicons dashicons-upload"></span>
    8383                        </button>
    8484                        <button class="button cpt-file-button button-secondary cpt-file-remove" <?php echo empty( $field_config['value'] ) ? ' disabled="disabled"' : ''; ?>
    85                                 title="<?php _e( 'Remove', 'custom-post-types' ); ?>"
    86                                 aria-label="<?php _e( 'Remove', 'custom-post-types' ); ?>">
     85                                title="<?php esc_attr_e( 'Remove', 'custom-post-types' ); ?>"
     86                                aria-label="<?php esc_attr_e( 'Remove', 'custom-post-types' ); ?>">
    8787                            <span class="dashicons dashicons-trash"></span>
    8888                        </button>
  • custom-post-types/trunk/includes/fields/class-cpt-field-radio.php

    r2989869 r3055467  
    5252            printf(
    5353                '<label><input type="radio" name="%s" value="%s"%s%s>%s<label><br>',
    54                 $input_name,
    55                 $value,
     54                $input_name, //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
     55                $value, //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
    5656                $value == $field_config['value'] ? ' checked="checked"' : '', //phpcs:ignore Universal.Operators.StrictComparisons
    5757                ! empty( $field_config['required'] ) ? ' required' : '',
    58                 $label
     58                $label //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
    5959            );
    6060        }
  • custom-post-types/trunk/includes/fields/class-cpt-field-repeater.php

    r3036818 r3055467  
    4040        ?>
    4141        <div class="cpt-repeater-section"
    42             data-fields="<?php echo htmlspecialchars( wp_json_encode( $fields ), ENT_QUOTES, 'UTF-8' ); ?>"
    43             data-parent="<?php echo $parent_base; ?>"
    44             data-fields-group="<?php echo $fields_group_id; ?>"
     42            data-fields="<?php echo htmlspecialchars( wp_json_encode( $fields ), ENT_QUOTES, 'UTF-8' ); //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>"
     43            data-parent="<?php echo $parent_base; //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>"
     44            data-fields-group="<?php esc_attr_e( $fields_group_id ); ?>"
    4545        >
    4646            <?php
    4747            foreach ( $values as $i => $value ) {
    4848                $parent = $parent_base . '[' . $i . ']';
    49                 echo self::render_group( $fields, $parent, $fields_group_id, $value );
     49                echo self::render_group( $fields, $parent, $fields_group_id, $value ); //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
    5050            }
    5151            ?>
    5252        </div>
    53         <button class="cpt-repeater-add" title="<?php _e( 'Add', 'custom-post-types' ); ?>">
     53        <button class="cpt-repeater-add" title="<?php esc_attr_e( 'Add', 'custom-post-types' ); ?>">
    5454            <span class="dashicons dashicons-insert"></span>
    5555        </button>
     
    7373                <div class="order"></div>
    7474                <button class="button cpt-repeater-button button-secondary move"
    75                         title="<?php _e( 'Reorder', 'custom-post-types' ); ?>"
    76                         aria-label="<?php _e( 'Reorder', 'custom-post-types' ); ?>">
     75                        title="<?php esc_attr_e( 'Reorder', 'custom-post-types' ); ?>"
     76                        aria-label="<?php esc_attr_e( 'Reorder', 'custom-post-types' ); ?>">
    7777                    <span class="dashicons dashicons-move"></span>
    7878                </button>
    7979                <button class="button cpt-repeater-button button-secondary remove"
    80                         title="<?php _e( 'Remove', 'custom-post-types' ); ?>"
    81                         aria-label="<?php _e( 'Remove', 'custom-post-types' ); ?>">
     80                        title="<?php esc_attr_e( 'Remove', 'custom-post-types' ); ?>"
     81                        aria-label="<?php esc_attr_e( 'Remove', 'custom-post-types' ); ?>">
    8282                    <span class="dashicons dashicons-remove"></span>
    8383                </button>
     
    9696                                    $extra_field['parent']          = $parent_field . '[extra]';
    9797                                    $extra_field['fields_group_id'] = $fields_group_id;
    98                                     echo cpt_fields()->get_field_template( $extra_field );
     98                                    echo cpt_fields()->get_field_template( $extra_field ); //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
    9999                                }
    100100                            }
     
    106106                    $field['parent']          = $parent_field;
    107107                    $field['fields_group_id'] = $fields_group_id;
    108                     echo cpt_fields()->get_field_template( $field );
     108                    echo cpt_fields()->get_field_template( $field ); //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
    109109                }
    110110                ?>
     
    112112            <div class="cpt-repeater-remove" aria-hidden="true">
    113113                <button class="button button-secondary abort"
    114                         title="<?php _e( 'Cancel', 'custom-post-types' ); ?>"
    115                         aria-label="<?php _e( 'Cancel', 'custom-post-types' ); ?>">
    116                     <?php _e( 'Cancel', 'custom-post-types' ); ?>
     114                        title="<?php esc_attr_e( 'Cancel', 'custom-post-types' ); ?>"
     115                        aria-label="<?php esc_attr_e( 'Cancel', 'custom-post-types' ); ?>">
     116                    <?php esc_attr_e( 'Cancel', 'custom-post-types' ); ?>
    117117                </button>
    118118                <button class="button button-primary confirm"
    119                         title="<?php _e( 'Confirm', 'custom-post-types' ); ?>"
    120                         aria-label="<?php _e( 'Confirm', 'custom-post-types' ); ?>">
    121                     <?php _e( 'Confirm', 'custom-post-types' ); ?>
     119                        title="<?php esc_attr_e( 'Confirm', 'custom-post-types' ); ?>"
     120                        aria-label="<?php esc_attr_e( 'Confirm', 'custom-post-types' ); ?>">
     121                    <?php esc_attr_e( 'Confirm', 'custom-post-types' ); ?>
    122122                </button>
    123123            </div>
     
    137137        foreach ( $fields as $field ) {
    138138            $result[ $field['key'] ] = array( 'type' => $field['type'] );
    139             if ( 'repeater' == $field['type'] ) {
     139            if ( 'repeater' === $field['type'] ) {
    140140                $result[ $field['key'] ]['fields'] = self::get_repeater_fields_map( $field['extra']['fields'] );
    141141            }
     
    161161        }
    162162
    163         if ( 'extra' == $meta_key && CPT_UI_PREFIX . '_field' == $field_group['id'] ) {
     163        if ( 'extra' === $meta_key && CPT_UI_PREFIX . '_field' === $field_group['id'] ) {
    164164            $fields     = self::get_repeater_fields_map( cpt_fields()->get_field( $meta_type )::get_extra() );
    165165            $meta_value = array( $meta_value );
     
    168168        foreach ( $meta_value as $i => $meta_group ) {
    169169            foreach ( $meta_group as $key => $value ) {
    170                 if ( 'extra' == $key && CPT_UI_PREFIX . '_field' == $field_group['id'] ) {
     170                if ( 'extra' === $key && CPT_UI_PREFIX . '_field' === $field_group['id'] ) {
    171171                    $meta_value[ $i ][ $key ] = self::sanitize_recursive( $value, $key, $meta_group['type'], $field_group, $content_type, $content_id, $fields );
    172                 } elseif ( 'repeater' == $fields[ $key ]['type'] ) {
     172                } elseif ( 'repeater' === $fields[ $key ]['type'] ) {
    173173                    $meta_value[ $i ][ $key ] = self::sanitize_recursive( $value, $key, 'repeater', $field_group, $content_type, $content_id, $fields[ $key ]['fields'] );
    174174                } else {
     
    178178        }
    179179
    180         return ( 'extra' == $meta_key && CPT_UI_PREFIX . '_field' == $field_group['id'] ) ? $meta_value[0] : $meta_value;
     180        return ( 'extra' === $meta_key && CPT_UI_PREFIX . '_field' === $field_group['id'] ) ? $meta_value[0] : $meta_value;
    181181    }
    182182}
     
    212212                    $field['parent']          = $parent . '[extra]';
    213213                    $field['fields_group_id'] = $fields_group_id;
    214                     echo cpt_fields()->get_field_template( $field );
     214                    echo cpt_fields()->get_field_template( $field ); //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
    215215                }
    216216
     
    238238        }
    239239
    240         if ( 'repeater' == $meta_type ) {
     240        if ( 'repeater' === $meta_type ) {
    241241            $fields     = CPT_Field_Repeater::get_repeater_fields_map( $field_group['fields'] )[ $meta_key ]['fields'];
    242242            $meta_value = CPT_Field_Repeater::sanitize_recursive( $meta_value, $meta_key, $meta_type, $field_group, $content_type, $content_id, $fields );
  • custom-post-types/trunk/includes/fields/class-cpt-field-time.php

    r2989869 r3055467  
    7272        }
    7373        $config_format = get_option( 'time_format' );
    74         return ! empty( $config_format ) ? date( $config_format, strtotime( $meta_value ) ) : $meta_value;
     74        return ! empty( $config_format ) ? date( $config_format, strtotime( $meta_value ) ) : $meta_value; //phpcs:ignore WordPress.DateTime.RestrictedFunctions.date_date
    7575    }
    7676}
  • custom-post-types/trunk/includes/templates/modal-feedback.php

    r2989869 r3055467  
    11<?php
     2// phpcs:ignoreFile
    23
    34defined( 'ABSPATH' ) || exit;
  • custom-post-types/trunk/includes/templates/page-tools.php

    r2989869 r3055467  
    11<?php
     2// phpcs:ignoreFile
    23
    34defined( 'ABSPATH' ) || exit;
     
    910);
    1011
    11 $requested_page = ! empty( $_GET['action'] ) && array_key_exists( $_GET['action'], $pages ) ? $_GET['action'] : 'main';
     12$requested_page = ! empty( $_GET['action'] ) && array_key_exists( $_GET['action'], $pages ) ? $_GET['action'] : 'main'; //phpcs:ignore WordPress.Security.NonceVerification
    1213
    1314$page_url = function ( $slug ) use ( $pages ) {
  • custom-post-types/trunk/readme.txt

    r3048971 r3055467  
    55Requires at least: 4.0
    66Tested up to: 6.4
    7 Stable tag: 5.0.2
     7Stable tag: 5.0.3
    88Requires PHP: 5.6
    99License: GPLv2 or later
    1010License URI: http://www.gnu.org/licenses/gpl-2.0.html
    1111
    12 Custom Post Types, Custom Fields, Custom Taxonomies, Custom Templates, Custom Admin Pages and Custom Admin Notices easily, directly from the WordPress dashboard without writing code.
     12Custom Post Types, Custom Fields, Custom Taxonomies, Custom Templates, Custom Admin Pages, Custom Admin Notices. Directly from the WP dashboard.
    1313
    1414== Description ==
     
    188188== Changelog ==
    189189
     190= 5.0.3 - 2024-03-20 =
     191* FIX: improve plugin bug feedback;
     192
    190193= 5.0.2 - 2024-03-11 =
    191194* FIX: improve plugin self-request security;
Note: See TracChangeset for help on using the changeset viewer.