Making WordPress.org

Changeset 13874

Timestamp:
07/04/2024 03:08:32 AM (5 weeks ago)
Author:
dd32
Message:

Plugin Directory: Always add the release metadata for plugin releases from tags.

See #7696.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/cli/class-import.php

    r13869 r13874  
    9595        $assets             = $data['assets'];
    9696        $headers            = $data['plugin_headers'];
     97
    9798        $stable_tag         = $data['stable_tag'];
    9899        $last_committer     = $data['last_committer'];
     
    168169                if ( ! $release ) {
    169170                    // Use the actual version for stable releases, otherwise fallback to the tag name, as we don't have the actual header data.
    170                     $version = ( $svn_changed_tag === $stable_tag ) ? $headers->Version : $svn_changed_tag;
     171                    $version = ( $svn_changed_tag === $stable_tag ) ? $ersion : $svn_changed_tag;
    171172
    172173                    Plugin_Directory::add_release(
     
    298299         */
    299300        if (
    300             ( ! isset( $headers->Version ) || $headers->Version != get_post_meta( $plugin->ID, 'version', true ) ) ||
     301            ( ! ersion != get_post_meta( $plugin->ID, 'version', true ) ) ||
    301302            $plugin->post_modified == '0000-00-00 00:00:00' ||
    302303            ( $svn_changed_tags && in_array( ( $stable_tag ?: 'trunk' ), $svn_changed_tags, true ) )
     
    437438        }
    438439
     440
     441
     442
     443
     444
     445
     446
     447
     448
     449
     450
     451
     452
    439453        $this->rebuild_affected_zips( $plugin_slug, $stable_tag, $current_stable_tag, $svn_changed_tags, $svn_revision_triggered );
    440454
    441455        // Finally, set the new version live.
    442456        update_post_meta( $plugin->ID, 'stable_tag', wp_slash( $stable_tag ) );
    443         update_post_meta( $plugin->ID, 'version',    wp_slash( $headers->Version ) );
     457        update_post_meta( $plugin->ID, 'version',    wp_slash( $ersion ) );
    444458        // Update the list of tags last, as it controls which ZIPs are present in the 'Previous versions' section and info API.
    445459        update_post_meta( $plugin->ID, 'tags',       wp_slash( $tagged_versions ) );
     
    512526                ) {
    513527                    unset( $versions_to_build[ $i ] );
    514                 } else {
    515                     $release['zips_built'] = true;
    516                     Plugin_Directory::add_release( $plugin, $release );
    517528                }
    518529            }
     
    541552        } catch ( Exception $e ) {
    542553            return false;
     554
     555
     556
     557
     558
     559
     560
     561
     562
     563
     564
     565
     566
     567
     568
    543569        }
    544570
Note: See TracChangeset for help on using the changeset viewer.