v1.8.1
This commit is contained in:
parent
7b7fff5246
commit
b6a55a7f04
27 changed files with 2221 additions and 45 deletions
|
|
@ -3,11 +3,12 @@
|
|||
* Plugin Name: Media Audit (by ROBOTSTXT)
|
||||
* Plugin URI: https://git.robotstxt.es/ROBOTSTXT/robotstxt-mediaaudit
|
||||
* Description: Internal media library usage auditing and external reverse image search to detect potential copyright issues.
|
||||
* Version: 1.7.1
|
||||
* Version: 1.8.1
|
||||
* Requires at least: 5.3
|
||||
* Tested up to: 7.0
|
||||
* Requires PHP: 8.0
|
||||
* Requires Plugins: action-scheduler
|
||||
* Network: true
|
||||
* Author: ROBOTSTXT
|
||||
* Author URI: https://www.robotstxt.es/
|
||||
* Contributors: javiercasares, robotstxt
|
||||
|
|
@ -23,8 +24,8 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
exit;
|
||||
}
|
||||
|
||||
define( 'ROBOTSTXT_MEDIAAUDIT_VERSION', '1.7.1' );
|
||||
define( 'ROBOTSTXT_MEDIAAUDIT_DB_VERSION', '1.2.0' );
|
||||
define( 'ROBOTSTXT_MEDIAAUDIT_VERSION', '1.8.1' );
|
||||
define( 'ROBOTSTXT_MEDIAAUDIT_DB_VERSION', '1.3.0' );
|
||||
define( 'ROBOTSTXT_MEDIAAUDIT_PLUGIN_FILE', __FILE__ );
|
||||
define( 'ROBOTSTXT_MEDIAAUDIT_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
|
||||
define( 'ROBOTSTXT_MEDIAAUDIT_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
|
||||
|
|
@ -33,19 +34,62 @@ require_once ROBOTSTXT_MEDIAAUDIT_PLUGIN_DIR . 'vendor/autoload.php';
|
|||
|
||||
use MediaRightsAudit\Core\Activator;
|
||||
use MediaRightsAudit\Core\Deactivator;
|
||||
use MediaRightsAudit\Core\NetworkActivator;
|
||||
use MediaRightsAudit\Core\Plugin;
|
||||
|
||||
register_activation_hook( __FILE__, array( Activator::class, 'activate' ) );
|
||||
register_deactivation_hook( __FILE__, array( Deactivator::class, 'deactivate' ) );
|
||||
use MediaRightsAudit\Network\Plugin as NetworkPlugin;
|
||||
|
||||
/**
|
||||
* Bootstraps the plugin.
|
||||
* Handles activation for both single-site and network-wide contexts.
|
||||
*
|
||||
* @param bool $network_wide True when activated network-wide in Multisite.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function robotstxt_mediaaudit_activate( bool $network_wide ): void {
|
||||
if ( is_multisite() && $network_wide ) {
|
||||
NetworkActivator::network_activate();
|
||||
} else {
|
||||
Activator::activate();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Handles deactivation for both single-site and network-wide contexts.
|
||||
*
|
||||
* @param bool $network_wide True when deactivated network-wide in Multisite.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function robotstxt_mediaaudit_deactivate( bool $network_wide ): void {
|
||||
if ( is_multisite() && $network_wide ) {
|
||||
NetworkActivator::network_deactivate();
|
||||
} else {
|
||||
Deactivator::deactivate();
|
||||
}
|
||||
}
|
||||
|
||||
register_activation_hook( __FILE__, 'robotstxt_mediaaudit_activate' );
|
||||
register_deactivation_hook( __FILE__, 'robotstxt_mediaaudit_deactivate' );
|
||||
|
||||
// Provision tables for newly created sites when the plugin is network-active.
|
||||
add_action( 'wp_initialize_site', array( NetworkActivator::class, 'on_new_site' ) );
|
||||
|
||||
/**
|
||||
* Bootstraps the site-level plugin.
|
||||
*
|
||||
* In Multisite central mode, registers a placeholder notice instead of the full admin UI
|
||||
* so all management happens from the network admin panel.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function robotstxt_mediaaudit_run(): void {
|
||||
$plugin = new Plugin();
|
||||
$plugin->run();
|
||||
|
||||
if ( is_multisite() ) {
|
||||
$network_plugin = new NetworkPlugin();
|
||||
$network_plugin->run();
|
||||
}
|
||||
}
|
||||
|
||||
add_action( 'plugins_loaded', 'robotstxt_mediaaudit_run' );
|
||||
|
|
|
|||
Loading…
Reference in a new issue