PluginProbe
ZIP AI – AI Website Builder & AI Agent / 0.0.13
ZIP AI – AI Website Builder & AI Agent v0.0.13
0.0.14 0.0.13 0.0.12 0.0.11 0.0.10 0.0.9 trunk 0.0.4 0.0.5 0.0.6 0.0.7 0.0.8
← All changes | uninstall.php +18 -13 0.0.7 → 0.0.13 View file →
@@ -38,27 +38,32 @@
38 38 // Per-user OAuth state transients (prefix match). A direct query is the
39 39 // only way to bulk-delete prefix-matched transients; caching and the
40 40 // standard API are not applicable during uninstall.
41 41 global $wpdb;
42 -// phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching
43 -$wpdb->query(
44 - $wpdb->prepare(
45 - "DELETE FROM {$wpdb->options} WHERE option_name LIKE %s OR option_name LIKE %s",
46 - $wpdb->esc_like( '_transient_zip_ai_oauth_state_' ) . '%',
47 - $wpdb->esc_like( '_transient_timeout_zip_ai_oauth_state_' ) . '%'
48 - )
42 +/**
43 + * Narrowed type for `$wpdb`.
44 + *
45 + * @var \wpdb $wpdb
46 + */
47 +$zip_ai_delete_transients_query = $wpdb->prepare(
48 + 'DELETE FROM %i WHERE option_name LIKE %s OR option_name LIKE %s',
49 + $wpdb->options,
50 + $wpdb->esc_like( '_transient_zip_ai_oauth_state_' ) . '%',
51 + $wpdb->esc_like( '_transient_timeout_zip_ai_oauth_state_' ) . '%'
49 52 );
53 +if ( is_string( $zip_ai_delete_transients_query ) ) {
54 + // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.PreparedSQL.NotPrepared -- built via $wpdb->prepare() with a %i table placeholder above; guarded is_string.
55 + $wpdb->query( $zip_ai_delete_transients_query );
56 +}
50 57
51 58 // Capability removal from every role.
52 59 // `manage_zip_mcp_assistant` is the capability the plugin adds today;
53 60 // `manage_zip_ai_assistant` may linger from older releases.
54 61 $zip_ai_roles = wp_roles();
55 -if ( isset( $zip_ai_roles->role_objects ) && is_array( $zip_ai_roles->role_objects ) ) {
56 - foreach ( $zip_ai_roles->role_objects as $zip_ai_role ) {
57 - foreach ( array( 'manage_zip_mcp_assistant', 'manage_zip_ai_assistant' ) as $zip_ai_cap ) {
58 - if ( $zip_ai_role->has_cap( $zip_ai_cap ) ) {
59 - $zip_ai_role->remove_cap( $zip_ai_cap );
60 - }
62 +foreach ( $zip_ai_roles->role_objects as $zip_ai_role ) {
63 + foreach ( array( 'manage_zip_mcp_assistant', 'manage_zip_ai_assistant' ) as $zip_ai_cap ) {
64 + if ( $zip_ai_role->has_cap( $zip_ai_cap ) ) {
65 + $zip_ai_role->remove_cap( $zip_ai_cap );
61 66 }
62 67 }
63 68 }
64 69