Changeset 12533
- Timestamp:
- 04/12/2023 05:24:19 AM (20 months ago)
- Location:
- sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/api/routes/class-plugin.php
r12157 r12533 113 113 } 114 114 115 $result['requires'] = get_post_meta( $post_id, 'requires', true ) ?: false; 116 $result['tested'] = get_post_meta( $post_id, 'tested', true ) ?: false; 117 $result['requires_php'] = get_post_meta( $post_id, 'requires_php', true ) ?: false; 118 $result['compatibility'] = array(); 115 $result['requires'] = get_post_meta( $post_id, 'requires', true ) ?: false; 116 $result['tested'] = get_post_meta( $post_id, 'tested', true ) ?: false; 117 $result['requires_php'] = get_post_meta( $post_id, 'requires_php', true ) ?: false; 118 $result['requires_plugins'] = get_post_meta( $post_id, 'requires_plugins', true ) ?: []; 119 $result['compatibility'] = array(); 119 120 120 121 if ( class_exists( '\WPORG_Ratings' ) ) { -
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/cli/class-import.php
r12532 r12533 42 42 // Plugin headers that are stored in plugin meta 43 43 public $plugin_headers = array( 44 // Header => meta_key 45 'Name' => 'header_name', 46 'PluginURI' => 'header_plugin_uri', 47 'Author' => 'header_author', 48 'AuthorURI' => 'header_author_uri', 49 'TextDomain' => 'header_textdomain', 50 'RequiresPlugins' => 'requires_plugins' 44 // Header => meta_key 45 'Name' => 'header_name', 46 'PluginURI' => 'header_plugin_uri', 47 'Author' => 'header_author', 48 'AuthorURI' => 'header_author_uri', 49 'TextDomain' => 'header_textdomain', 51 50 52 51 // These headers are stored in these fields, but are handled separately. 53 // 'Version' => 'version', 54 // 'RequiresWP' => 'requires', 55 // 'RequiresPHP' => 'requires_php', 52 // 'Version' => 'version', 53 // 'RequiresWP' => 'requires', 54 // 'RequiresPHP' => 'requires_php', 55 // 'RequiresPlugins' => 'requires_plugins' 56 56 ); 57 57 … … 240 240 $plugin_names[ $headers->Name ] = $headers->Version; 241 241 update_post_meta( $plugin->ID, 'plugin_name_history', wp_slash( $plugin_names ) ); 242 } 243 244 // Validate whether the dependencies are met by WordPress.org-hosted plugins. 245 $requires_plugins = array_map( 'trim', explode( ',', $headers->RequiresPlugins ) ); 246 $requires_plugins_unmet = false; 247 foreach ( $requires_plugins as $requires_plugin_slug ) { 248 // TODO: Add support for premium plugins. 249 $requires_plugin_post = Plugin_Directory::get_plugin_post( $requires_plugin_slug ); 250 if ( 251 ! $requires_plugin_post || 252 'publish' !== $requires_plugin_post->post_status 253 ) { 254 $requires_plugins_unmet = true; 255 break; 256 } 257 } 258 259 update_post_meta( $plugin->ID, 'requires_plugins', wp_slash( $requires_plugins ) ); 260 if ( $requires_plugins_unmet ) { 261 update_post_meta( $plugin->ID, '_requires_plugins_unmet', true ); 262 } else { 263 delete_post_meta( $plugin->ID, '_requires_plugins_unmet' ); 242 264 } 243 265 -
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/shortcodes/class-upload-handler.php
r12532 r12533 378 378 'header_textdomain' => $this->plugin['TextDomain'], 379 379 'header_description' => $this->plugin['Description'], 380 'requires_plugins' => $this->plugin['RequiresPlugins'],380 'requires_plugins' => array_map( 'trim', explode( ',', $this->plugin['RequiresPlugins'] ) ), 381 381 'assets_screenshots' => array(), 382 382 'assets_icons' => array(),
Note: See TracChangeset
for help on using the changeset viewer.