Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 10 additions & 13 deletions integrate-rybbit/integrate-rybbit.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/*
Plugin Name: Integrate Rybbit
Plugin URI: https://github.com/maki-it/rybbit-wordpress-plugin
Plugin URI: https://wordpress.org/plugins/integrate-rybbit/
Description: Add and manage the Rybbit tracking script.
Version: 0.0.0
Tested up to: 6.9
Expand Down Expand Up @@ -43,17 +43,6 @@
// Initialize main plugin class
new Integrate_Rybbit();

// Enable auto-updates toggle for WordPress.org plugins (WordPress 5.5+)
// This allows users to enable/disable automatic updates via the Plugins page
add_filter('auto_update_plugin', function($update, $item) {
if (isset($item->plugin) && $item->plugin === INTEGRATE_RYBBIT_PLUGIN_BASENAME) {
// Return true to enable auto-updates, false to disable
// null means let WordPress use the default/user preference
return $update;
}
return $update;
}, 10, 2);

// Initialize context-specific logic
if (is_admin()) {
new Integrate_Rybbit_Admin();
Expand Down Expand Up @@ -83,4 +72,12 @@
if (get_option('rybbit_delete_data_on_uninstall', null) === null) {
add_option('rybbit_delete_data_on_uninstall', '1');
}
});
});

// Enable automatic updates for this plugin
add_filter('auto_update_plugin', function ($update, $item) {
if (isset($item->plugin) && $item->plugin === INTEGRATE_RYBBIT_PLUGIN_BASENAME) {
return true;
}
return $update;
}, 10, 2);