diff --git a/cloudinary-update-tester/cloudinary-update-tester.php b/cloudinary-update-tester/cloudinary-update-tester.php new file mode 100644 index 000000000..667c76bf2 --- /dev/null +++ b/cloudinary-update-tester/cloudinary-update-tester.php @@ -0,0 +1,58 @@ +no_update ) ) { + $slug = 'cloudinary-image-management-and-manipulation-in-the-cloud-cdn/cloudinary.php'; + if ( ! empty( $data->no_update[ $slug ] ) ) { + $file = plugin_dir_path( __FILE__ ) . 'cloudinary.zip'; + $data->no_update[ $slug ]->package = $file; + $data->no_update[ $slug ]->new_version = 2.0; + $data->response[ $slug ] = $data->no_update[ $slug ]; + unset( $data->no_update[ $slug ] ); + deactivate_plugins( 'cloudinary-update-tester/cloudinary-update-tester.php' ); + } + } + + return $data; +} + +add_filter( 'pre_set_site_transient_update_plugins', 'cld_test_check_update', 100 ); + +/** + * Delete the update transient on activation. + */ +function cld_test_init_update() { + delete_site_transient( 'update_plugins' ); +} + +register_activation_hook( __FILE__, 'cld_test_init_update' ); diff --git a/cloudinary-update-tester/readme.txt b/cloudinary-update-tester/readme.txt new file mode 100644 index 000000000..da0fa5eca --- /dev/null +++ b/cloudinary-update-tester/readme.txt @@ -0,0 +1,5 @@ +This tests the update process of the Cloudinary plugin. + +To create a new test package, simply add the plugin zip package here and name it cloudinary.zip + +Then activate this plugin in WordPress. The cloudinary plugin listing will show an available update and this plugin will disable itself.