WordPress.org

Making WordPress.org


Ignore:
Timestamp:
10/13/17 08:56:56 (2 months ago)
Author:
dd32
Message:

Plugin Directory: Generate md5 hashes for plugins.

This is a POC and may change or be removed in the future, it's here for testing purposes.

A api.wordpress.org endpoint may be available in the future to access it.
This is only enabled for the 'exploit-scanner' plugin at present, purely for testing, as it publishes the md5 hashes of its own files already

Compare https://wordpress.org/plugins/exploit-scanner/ to https://downloads.wordpress.org/plugins/exploit-scanner.1.5.2.checksums.json

See #3192

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/bin/rebuild-zip.php

    r5175 r6022  
    11<?php 
    22namespace WordPressdotorg\Plugin_Directory; 
     3use WordPressdotorg\Plugin_Directory\Plugin_Directory; 
    34use WordPressdotorg\Plugin_Directory\Tools\SVN; 
    45 
     
    8687    $zip_builder = new ZIP\Builder(); 
    8788 
     89    $plugin_post = Plugin_Directory::get_plugin_post( $plugin_slug ); 
     90    if ( ! $plugin_post ) { 
     91        throw new Exception( "Could not locate plugin post" ); 
     92    } 
     93    $stable_tag = get_post_meta( $plugin_post->ID, 'stable_tag', true ) ?? 'trunk'; 
     94 
    8895    // (re)Build & Commit 5 Zips at a time to avoid limitations. 
    8996    foreach ( array_chunk( $versions, 5 ) as $versions_to_build ) { 
     
    9198            $plugin_slug, 
    9299            $versions_to_build, 
    93             "{$plugin_slug}: Rebuild triggered by " . php_uname('n' ) 
     100            "{$plugin_slug}: Rebuild triggered by " . php_uname('n' ), 
     101            $stable_tag 
    94102        ); 
    95103    } 
Note: See TracChangeset for help on using the changeset viewer.