HEX
Server: Apache
System: Linux outside 5.4.8_Algonet_ZeroMAC_0.9.4.8 #6 SMP Mon Feb 3 20:36:07 CET 2020 x86_64
User: server (1002)
PHP: 8.3.20
Disabled: exec,passthru,shell_exec,system,proc_open,popen,curl_multi_exec,parse_ini_file,show_source
Upload Files
File: /home/muoapartman/www/wp-content/plugins/animated-blocks/block/index.php
<?php
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

/**
 * Returns the content of the block.
 *
 * @param array $attributes Block attributes.
 *
 * @param string $content Block save content.
 */
function ab_render_animated_block( $attributes, $content ) {
	// Frontend JS
	if ( ! is_admin() ) {
		wp_enqueue_script(
			'scroll-class',
			plugins_url( 'dist/assets/js/scrollClass.min.js',  __DIR__ ),
			[ 'jquery' ],
			filemtime( AB_PLUGIN_DIR . '/dist/assets/js/scrollClass.min.js' ),
			true
		);

		wp_enqueue_script(
			'ab-animated-block',
			plugins_url( 'block/view.js',  __DIR__ ),
			[ 'jquery', 'scroll-class' ],
			filemtime( AB_PLUGIN_DIR . '/block/view.js' ),
			true
		);
	}

	return $content;
}

/**
 * Register the block.
 */
function ab_register_animated_block() {
	if ( ! function_exists( 'register_block_type' ) ) {
		return;
	}

	// Editor JS
	wp_register_script(
		'ab-animated-block-editor',
		plugins_url( 'block/editor.js',  __DIR__ ),
		[ 'jquery' ],
		filemtime( AB_PLUGIN_DIR . '/block/editor.js' ),
		true
	);

	register_block_type( __DIR__,
		array(
			'render_callback' => 'ab_render_animated_block',
			'editor_script'   => 'ab-animated-block-editor'
	  )
	);
}

add_action( 'init', 'ab_register_animated_block' );