PluginProbe
Image Optimizer – Compress Images and Convert to WebP or AVIF / 1.7.7
Image Optimizer – Compress Images and Convert to WebP or AVIF v1.7.7
1.7.7 1.7.6 1.7.5 1.7.4 trunk 1.0.0 1.0.1 1.0.2 1.1.0 1.2.0 1.2.1 1.3.0 1.4.0 1.4.1 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 1.6.0 1.6.1 1.6.2 1.6.3 1.6.4 1.6.5 All 33 releases
← All changes | classes/utils.php +22 -0 1.5.01.7.7 View file →
@@ -117,5 +117,27 @@
117 117
118 118 public static function user_is_admin(): bool {
119 119 return current_user_can( 'manage_options' );
120 120 }
121 +
122 + public static function is_wp_dashboard_page(): bool {
123 + $current_screen = get_current_screen();
124 +
125 + return str_contains( $current_screen->id, 'dashboard' );
126 + }
127 +
128 + public static function is_wp_updates_page(): bool {
129 + $current_screen = get_current_screen();
130 +
131 + return str_contains( $current_screen->id, 'update' );
132 + }
133 +
134 + public static function get_upgrade_link( $link ): string {
135 + $subscription_id = get_option( 'image_optimizer_subscription_id' );
136 +
137 + if ( ! $subscription_id ) {
138 + return $link;
139 + }
140 +
141 + return add_query_arg( 'subscription_id', $subscription_id, $link );
142 + }
121 143 }