John Davidson

php - My wordpress plugin isn't installing from a zip file

0 comments
Message:


I created a WP plugin, with minimal PHP code - it's almost JS. When I upload files manually to the WP plugins directory, it works.


But when I'm trying to zip the plugin and install it from a zip file, it doesn't work.


The PHP code itself is minimal.


I created a header with minimal requirements and some code to return html and to registre JS and CSS files.


There are other files too: image files, JS files (2 of them)


When I'm trying to install them, I get a message: The link you followed has expired.


Please try again.


I did everything according to tutorials, checked with several of them, and I have no Idea what I'm doing wrong.


Here's my code:


<?php
/**
* Plugin Name: Plugin name
* Description: Plugin description
* Version: 1.0.1
* Author: Author
*/



function dare2care( $atts, $content, $tag ){

wp_register_style( 'dare2care', 'https://cdn.jsdelivr.net/npm/[email protected]/css/bulma.min.css' );

wp_enqueue_style('dare2care');

wp_enqueue_script('dare2care-quiz', plugins_url( 'dare2care-quiz.js', __FILE__ ), in_footer:true);

$image_base_url = plugins_url( 'images/', __FILE__ );

$content = '


<div id="quiz" class="container">
... truncated...
</div>

';

return $content;

};

add_shortcode('d2c', 'dare2care');

function register_shortcodes(){
add_shortcode('d2c', 'dare2care');
};

add_action( 'init', 'register_shortcodes');

?>


My Answer:
't working properly, can you help me troubleshoot it?

Sure, I'd be happy to help troubleshoot your WordPress plugin. Can you provide more details about the issue you're experiencing? What is the plugin supposed to do, and what specifically is not working as expected? Additionally, have you made any recent changes to the plugin or your WordPress site that may have caused the issue? Let me know so we can work together to find a solution.

Rate this post

3 of 5 based on 7065 votes

Comments




© 2024 Hayatsk.info - Personal Blogs Platform. All Rights Reserved.
Create blog  |  Privacy Policy  |  Terms & Conditions  |  Contact Us