Plugin Directory

Changeset 3407976


Ignore:
Timestamp:
12/02/2025 12:26:07 PM (3 months ago)
Author:
digibrief
Message:

Bump to 1.0.3 – 6.9 compatibility & Plugin Check cleanup

Location:
cubelaunch/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • cubelaunch/trunk/coming-soon-template.php

    r3341115 r3407976  
    88
    99// Retrieve options once at the top
    10 $options = get_option('cubelaunch_settings');
    11 if (!is_array($options)) {
    12     $options = [];
     10// RENAMED VARIABLES to satisfy PrefixAllGlobals check
     11$cubelaunch_options = get_option('cubelaunch_settings');
     12if (!is_array($cubelaunch_options)) {
     13    $cubelaunch_options = [];
    1314}
    14 $title_text = isset($options['cubelaunch_title']) ? $options['cubelaunch_title'] : '';
    15 $about_text = isset($options['cubelaunch_about_text']) ? $options['cubelaunch_about_text'] : '';
    16 $show_title = !empty($options['display_title']) && !empty($title_text);
    17 $show_about = !empty($options['display_about_text']) && !empty($about_text);
    18 $show_form  = !empty($options['display_subscription_form']);
     15$cubelaunch_title_text = isset($cubelaunch_options['cubelaunch_title']) ? $cubelaunch_options['cubelaunch_title'] : '';
     16$cubelaunch_about_text = isset($cubelaunch_options['cubelaunch_about_text']) ? $cubelaunch_options['cubelaunch_about_text'] : '';
     17$cubelaunch_show_title = !empty($cubelaunch_options['display_title']) && !empty($cubelaunch_title_text);
     18$cubelaunch_show_about = !empty($cubelaunch_options['display_about_text']) && !empty($cubelaunch_about_text);
     19$cubelaunch_show_form  = !empty($cubelaunch_options['display_subscription_form']);
    1920
    2021// Get the General Text Color setting (provide a default)
    21 $general_text_color = isset($options['text_color']) ? sanitize_hex_color($options['text_color']) : '#FFFFFF'; // Default to white
     22$cubelaunch_text_color = isset($cubelaunch_options['text_color']) ? sanitize_hex_color($cubelaunch_options['text_color']) : '#FFFFFF'; // Default to white
    2223
    2324?>
     
    7071
    7172            <?php // --- Display Title ---
    72             if ( $show_title ): ?>
     73            if ( $cubelaunch_show_title ): ?>
    7374                <header class="cubelaunch-title">
    7475                    <?php // Apply the General Text Color as an inline style to the H1 ?>
    75                     <h1 style="color: <?php echo esc_attr( $general_text_color ); ?>;">
     76                    <h1 style="color: <?php echo esc_attr( $cubelaunch_text_color ); ?>;">
    7677                        <?php
    7778                            // Output sanitized title. Use nl2br() if needed.
    78                             echo wp_kses_post( nl2br( $title_text ) );
     79                            echo wp_kses_post( nl2br( $cubelaunch_title_text ) );
    7980                        ?>
    8081                    </h1>
     
    8788
    8889            <?php // --- Display About Text ---
    89             if ( $show_about ) : ?>
     90            if ( $cubelaunch_show_about ) : ?>
    9091                <section id="about-section" class="cubelaunch-about">
    9192                    <!-- Apply the General Text Color as an inline style -->
    92                     <div class="cubelaunch-text" style="color: <?php echo esc_attr( $general_text_color ); ?>;">
     93                    <div class="cubelaunch-text" style="color: <?php echo esc_attr( $cubelaunch_text_color ); ?>;">
    9394                        <?php
    94                             echo wp_kses_post( wpautop( $about_text ) );
     95                            echo wp_kses_post( wpautop( $cubelaunch_about_text ) );
    9596                        ?>
    9697                    </div>
     
    99100
    100101            <?php // --- Display Subscription Form ---
    101             if ( $show_form ): // $show_form is still controlled by 'display_subscription_form' checkbox
    102                 $form_integration_code = isset($options['subscription_form_integration']) ? $options['subscription_form_integration'] : '';
     102            if ( $cubelaunch_show_form ): // $show_form is still controlled by 'display_subscription_form' checkbox
     103                $cubelaunch_form_code = isset($cubelaunch_options['subscription_form_integration']) ? $cubelaunch_options['subscription_form_integration'] : '';
    103104            ?>
    104105                <section id="subscription-section" class="cubelaunch-subscription">
    105106                    <?php
    106                     if ( !empty($form_integration_code) ) {
    107                         echo do_shortcode( wp_kses_post( $form_integration_code ) ); // Process shortcodes and sanitize
     107                    if ( !empty($cubelaunch_form_code) ) {
     108                        echo do_shortcode( wp_kses_post( $cubelaunch_form_code ) ); // Process shortcodes and sanitize
    108109                    } else {
    109110                        // Optional: Display a message if the form code is empty but display is checked
    110                         echo '<p style="color:' . esc_attr( $general_text_color ) . ';">' . esc_html__( '[Subscription form content to be configured in settings.]', 'cubelaunch' ) . '</p>';
     111                        echo '<p style="color:' . esc_attr( $cubelaunch_text_color ) . ';">' . esc_html__( '[Subscription form content to be configured in settings.]', 'cubelaunch' ) . '</p>';
    111112                    }
    112113                    ?>
     
    119120    <?php
    120121    /* ---------- CubeLaunch credit link ---------- */
    121     if ( ! empty( $options['show_credit_link'] ) ) {
     122    if ( ! empty( $cubelaunch_options['show_credit_link'] ) ) {
    122123
    123124        // Only show when the user has enabled it (default is off in .org).
    124125        // If explicitly opted in, allow referrer (strict policy) and remove nofollow/noreferrer.
    125         $opted_in = ! empty( $options['credit_link_opted_in'] );
     126        $cubelaunch_opted_in = ! empty( $cubelaunch_options['credit_link_opted_in'] );
    126127
    127         $rel_attr = $opted_in
     128        $cubelaunch_rel_attr = $cubelaunch_opted_in
    128129            ? 'ugc noopener'
    129130            : 'nofollow ugc noopener noreferrer';
    130131
    131         $ref_policy = $opted_in
     132        $cubelaunch_ref_policy = $cubelaunch_opted_in
    132133            ? 'strict-origin-when-cross-origin'
    133134            : 'no-referrer';
     
    152153     </footer>',
    153154    esc_url( 'https://digibrief.com/' ),
    154     esc_attr( $rel_attr ),
    155     esc_attr( $general_text_color ),
     155    esc_attr( $cubelaunch_rel_attr ),
     156    esc_attr( $cubelaunch_text_color ),
    156157    esc_html__( 'Powered by CubeLaunch', 'cubelaunch' ),
    157     esc_attr( $ref_policy )
     158    esc_attr( $cubelaunch_ref_policy )
    158159);
    159160    }
  • cubelaunch/trunk/cubelaunch.php

    r3349581 r3407976  
    77Plugin Name: CubeLaunch
    88Description: Displays rotatable shapes with customisable faces for shortcode or block editor insertion, or a separate Coming Soon override.
    9 Version: 1.0.2
     9Version: 1.0.3
    1010Author: DigiBrief
    1111Text Domain: cubelaunch
     
    3131// --- Define Core Version Constant ---
    3232if ( ! defined( 'CUBELAUNCH_CORE_VERSION' ) ) {
    33     define( 'CUBELAUNCH_CORE_VERSION', '1.0.2' );
     33    define( 'CUBELAUNCH_CORE_VERSION', '1.0.3' );
    3434}
    3535
     
    17141714
    17151715        /* ───── Media URL ───── */
    1716         // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
    1717         if ( isset( $_POST[ $media_key ] ) ) {
    1718             // 1. Pull raw input once, unslash it immediately.
    1719             $media_raw = wp_unslash( $_POST[ $media_key ] );
    1720 
    1721             // 2. Trim + esc_url_raw() sanitises & validates the URL.
    1722             $sanitized_value = esc_url_raw( trim( $media_raw ) );
    1723         } else {
    1724             $sanitized_value = '';
    1725         }
    1726 
    1727         if ( '' !== $sanitized_value ) {
    1728             $path           = wp_parse_url( $sanitized_value, PHP_URL_PATH );
    1729             $file_extension = strtolower( pathinfo( $path, PATHINFO_EXTENSION ) );
    1730             $video_exts     = [ 'mp4', 'webm', 'mov', 'ogv' ];
    1731 
    1732             if ( in_array( $file_extension, $video_exts, true ) ) {
    1733                 $sanitized_value = ''; // Core rejects video URLs
    1734             }
    1735         }
    1736 
    1737         if ( '' !== $sanitized_value ) {
    1738             update_post_meta( $post_id, $media_key, $sanitized_value );
    1739         } else {
    1740             delete_post_meta( $post_id, $media_key );
    1741         }
     1716        /*
     1717         * Use filter_input() to satisfy Plugin Check/WordPressCS security sniff.
     1718         * This replaces direct access to $_POST[ $media_key ].
     1719         */
     1720        $media_raw       = filter_input( INPUT_POST, $media_key, FILTER_UNSAFE_RAW );
     1721        $sanitized_value = '';
     1722
     1723        if ( is_string( $media_raw ) && '' !== $media_raw ) {
     1724            // Unslash and sanitize the URL.
     1725            $sanitized_value = esc_url_raw( trim( wp_unslash( $media_raw ) ) );
     1726        }
     1727
     1728        if ( '' !== $sanitized_value ) {
     1729            $path           = wp_parse_url( $sanitized_value, PHP_URL_PATH );
     1730            $file_extension = strtolower( pathinfo( $path, PATHINFO_EXTENSION ) );
     1731
     1732            // Core rejects video URLs in this field
     1733            if ( in_array( $file_extension, $video_exts, true ) ) {
     1734                $sanitized_value = '';
     1735            }
     1736        }
     1737
     1738        if ( '' !== $sanitized_value ) {
     1739            update_post_meta( $post_id, $media_key, $sanitized_value );
     1740        } else {
     1741            delete_post_meta( $post_id, $media_key );
     1742        }
    17421743
    17431744        /* Remove Pro‑only meta for this face */
  • cubelaunch/trunk/readme.txt

    r3349581 r3407976  
    44Donate link: https://paypal.me/digibrief
    55Requires at least: 5.8
    6 Tested up to: 6.8
     6Tested up to: 6.9
    77Requires PHP: 7.4
    8 Stable tag: 1.0.2
     8Stable tag: 1.0.3
    99License: GPLv2 or later
    1010License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    178178== Changelog ==
    179179
     180= 1.0.3 =
     181* Update: Confirmed compatibility with WordPress 6.9.
     182* Security/Standards: Replaced direct $_POST access with filter_input() and improved sanitization to comply with Plugin Check.
     183* Standards: Prefixed global-scope variables in template and uninstall files to prevent potential conflicts.
     184
    180185= 1.0.2 =
    181186* Fix: Eliminated black halo/“shadow” around PNG/WebP textures with transparency on WebGL shapes.
  • cubelaunch/trunk/uninstall.php

    r3341115 r3407976  
    33
    44// if uninstall.php is not called by WordPress, die
    5 if (!defined('WP_UNINSTALL_PLUGIN')) {
     5if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
    66    die;
    77}
    88
    99// Delete the main settings option
    10 delete_option('cubelaunch_settings');
     10delete_option( 'cubelaunch_settings' );
    1111
    1212// Delete the license status
    13 delete_option('cubelaunch_pro_license_status');
    14 delete_option('cubelaunch_pro_license_data');
     13delete_option( 'cubelaunch_pro_license_status' );
     14delete_option( 'cubelaunch_pro_license_data' );
    1515
    1616// Delete all cubelaunch_shape posts and their meta
    17 $all_shapes = get_posts(array(
    18     'post_type' => 'cubelaunch_shape',
     17// We prefix the variable to satisfy NamingConventions.PrefixAllGlobals
     18$cubelaunch_all_shapes = get_posts( array(
     19    'post_type'   => 'cubelaunch_shape',
    1920    'numberposts' => -1,
    2021    'post_status' => 'any', // Get all statuses including trash
    21 ));
     22    'fields'      => 'ids', // Optimization: fetch IDs only
     23) );
    2224
    23 if (!empty($all_shapes)) {
    24     foreach ($all_shapes as $shape) {
    25         wp_delete_post($shape->ID, true); // true = bypass trash and force delete
     25if ( ! empty( $cubelaunch_all_shapes ) ) {
     26    foreach ( $cubelaunch_all_shapes as $cubelaunch_shape_id ) {
     27        wp_delete_post( $cubelaunch_shape_id, true ); // true = bypass trash and force delete
    2628    }
    2729}
Note: See TracChangeset for help on using the changeset viewer.