Changeset 8918
- Timestamp:
- 06/05/2019 04:34:52 AM (6 years 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/class-plugin-directory.php
r8902 r8918 885 885 } 886 886 887 // Trim off special characters, only allowing wordy characters at the end of searches. s887 // Trim off special characters, only allowing wordy characters at the end of searches. 888 888 $s = preg_replace( '!(\W+)$!i', '', $s ); 889 889 // ..and whitespace -
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/jobs/class-manager.php
r8461 r8918 234 234 * 235 235 * The jobs are queued for 1 minutes time to avoid recurring job failures from repeating too soon. 236 * 237 * This method is called on wp-admin pageviews and on a two-minutely cron task. 236 238 */ 237 239 public function register_cron_tasks() { … … 249 251 } 250 252 if ( ! wp_next_scheduled( 'plugin_directory_check_cronjobs' ) ) { 253 // This function 251 254 wp_schedule_event( time() + 60, 'every_120s', 'plugin_directory_check_cronjobs' ); 252 255 } 253 256 if ( ! wp_next_scheduled ( 'plugin_directory_translation_sync' ) ) { 254 257 wp_schedule_event( time() + 60, 'daily', 'plugin_directory_translation_sync' ); 258 } 259 260 // Check to see if `WP_CORE_LATEST_RELEASE` has changed since we last ran. 261 if ( defined( 'WP_CORE_LATEST_RELEASE' ) && get_option( 'plugins_last_core_release_seen' ) !== WP_CORE_LATEST_RELEASE ) { 262 update_option( 'plugins_last_core_release_seen', WP_CORE_LATEST_RELEASE ); 263 264 // If the next "Meta Sync" is more than 5 minutes away, perform one ASAP. 265 if ( wp_next_scheduled( 'plugin_directory_meta_sync' ) > ( time() + 5 * MINUTE_IN_SECONDS ) ) { 266 wp_schedule_single_event( time() + 10, 'plugin_directory_meta_sync' ); 267 } 255 268 } 256 269 } -
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/jobs/class-meta-sync.php
r6642 r8918 107 107 } 108 108 109 $equivs = wporg_get_version_equivalents(); 110 $equivs_key = md5( serialize( $equivs ) ); 111 if ( $equivs_key === get_option( 'plugin_last_tested_sync' ) ) { 112 return; 113 } 109 $equivs = wporg_get_version_equivalents(); 114 110 115 111 $latest_equiv = array(); … … 121 117 122 118 $tested_meta_value_esc_sql = '"' . implode( '", "', array_map( 'esc_sql', array_keys( $latest_equiv ) ) ) . '"'; 123 $tested_values = $wpdb->get_results( "SELECT post_id, meta_value FROM {$wpdb->postmeta}WHERE meta_key = 'tested' AND meta_value IN( {$tested_meta_value_esc_sql} )" );119 $tested_values = $wpdb->get_results( "SELECT post_id, post_name, meta_value FROM {$wpdb->postmeta} pm JOIN {$wpdb->posts} p ON pm.post_id = p.ID WHERE meta_key = 'tested' AND meta_value IN( {$tested_meta_value_esc_sql} )" ); 124 120 125 121 foreach ( $tested_values as $row ) { … … 129 125 $latest_equiv[ $row->meta_value ] 130 126 ); 127 128 // Update the API endpoints with the new data 129 API_Update_Updater::update_single_plugin( $row->post_name ); 131 130 } 132 133 update_option( 'plugin_last_tested_sync', $equivs_key );134 131 } 135 132 }
Note: See TracChangeset
for help on using the changeset viewer.