Hello,
When I tried to install SimTerm, running WordPress 6.1.1 with PHP 8.0.24, I came across some errors relating to the use of static methods, which I eventually solved, so I’m reporting my experiences here.
On installing the plugin,
Error: Non-static method SimTermLoader::Init() cannot be called statically in /wp-content/plugins/simterm/simterm.php on line 57
In simterm.php, I changed:
SimTermLoader::Init();
to:
$simterminal = new SimTermLoader();
$simterminal->Init();
The next error reported was:
PHP Fatal error: Uncaught TypeError: call_user_func_array(): Argument #1 ($callback) must be a valid callback, non-static method SimTermLoader::basic_init() cannot be called statically
Solved this by declaring static method, i.e. public static function basic_init(), public static function settingsInit(), public static function load_textdomain()
At this point, the plugin can be activated, but when trying to insert a shortcode (using Twenty Twenty-Two theme), I received the following error:
Uncaught TypeError: call_user_func_array(): Argument #1 ($callback) must be a valid callback, class SimTerm does not have a method "enqueue_scripts"
The source of the error is simterm-core.php, function simterm_shortcode($atts, $content=””). In lines 27-31, we have:
add_action('wp_enqueue_scripts', array($this, 'enqueue_scripts'));
wp_enqueue_script('simterm-showyourterms', plugins_url('js/show-your-terms.min.js',__FILE__), array(), '20160705', true);
wp_enqueue_script('simterm-launcher', plugins_url('js/simterm.js',__FILE__), array('simterm-showyourterms'), '20160705', true);
wp_enqueue_style('simterm-showyourtermscss', plugins_url('css/show-your-terms.min.css', __FILE__), array(), '20160705', 'all');
wp_enqueue_style('simterm-extracss', plugins_url('css/simterm.css', __FILE__), array(), '20160705', 'all');
I found I could clear these errors by slightly changing the parameters in each wp_enqueue_script() call, e.g., for the first:
wp_enqueue_script (
'simterm-showyourterms',
plugin_dir_url( __FILE__ ) . 'js/show-your-terms.min.js',
array(),
'20160705',
true
);
(Similarly for the others.)
That seems to be all the changes needed, but I would be grateful for others to test and if there is confirmation that these fixes work, then it would be good if the plugin were updated.
I like the plugin and think the styling and animation work well.
– Paul
]]>Servus Community,
I am trying to deactivate the animation in the Simterm plugin. In the readme file it says that a shortcode instruction switches it on and off individually, but that doesn’t work:
* Setting to enable/disable automatic animation (default enabled)
* Shortcode settings (animate=”1/0″ , statusbar=”1/0″) to apply to individual terms
In the editor, I then tried this as follows. But it has not changed anything:
[simterm animate=”0″]Content[/simterm]
I also found a setting in the simterm-settings.php file but changing the value didn’t change that either:
add_option('simterm-default-animated', 0);
How can I disable the animation either permanently or individually?
Thx & Bye Tom
]]>Hey,
The plugin is awesome, but shortcodes are going away with Guttenberg. Do you have any plan to release a Guttenberg block?
]]>